[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-03-07 Thread Nikita Popov via Phabricator via cfe-commits
nikic requested changes to this revision. nikic added a comment. This revision now requires changes to proceed. The original issue has been fixed by the mentioned LLVM changes. As such, I don't think we need to actually do anything on the Clang side. Please let me know if you're still seeing

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-02-01 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. I've found another bug in LLVM, fixed with https://github.com/llvm/llvm-project/commit/78f88082de3627ea04501c83a08f52cf1e60b4f7. After that change, the test case from https://github.com/llvm/llvm-project/issues/59580 appears to be handled correctly, it contains this in

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-31 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 added a comment. @nikic ,is that changes are ok ? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-31 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 updated this revision to Diff 493623. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872 Files: clang/lib/CodeGen/CGExpr.cpp clang/test/CodeGen/inbounds.c llvm/include/llvm/IR/ConstantFold.h llvm/lib/IR/ConstantFold.cpp

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-31 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 added a comment. In D142872#4093093 , @nikic wrote: > @umesh.kalappa0 This issue should be fixed by > https://github.com/llvm/llvm-project/commit/5f01a626dd0615df49773d419c75aeb33666ee83. > Can you please give it another try? Thank you

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-31 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 updated this revision to Diff 493612. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872 Files: clang/lib/CodeGen/CGExpr.cpp clang/test/CodeGen/inbounds.c llvm/include/llvm/IR/ConstantFold.h llvm/lib/IR/ConstantFold.cpp

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-31 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. @umesh.kalappa0 This issue should be fixed by https://github.com/llvm/llvm-project/commit/5f01a626dd0615df49773d419c75aeb33666ee83. Can you please give it another try? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. @umesh.kalappa0 I see. That part is actually a bug in LLVM. I'm working on a fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872 ___ cfe-commits mailing list

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 added a comment. In D142872#4090304 , @nikic wrote: > CreateConstArrayGEP currently always creates an inbounds GEP. You need to > modify it make inbounds optional or use a different method, not suppress it > in the constant folding

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 added a comment. In D142872#4090317 , @nikic wrote: > You also shouldn't need to introduce any new handling for the fwrapv option. > I'm not sure how exactly it is currently threaded through, but there must be > existing handling for it

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 updated this revision to Diff 493282. umesh.kalappa0 edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142872/new/ https://reviews.llvm.org/D142872 Files: clang/lib/CodeGen/CGExpr.cpp clang/test/CodeGen/inbounds.c

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. You also shouldn't need to introduce any new handling for the fwrapv option. I'm not sure how exactly it is currently threaded through, but there must be existing handling for it already. For example, there is isSignedOverflowDefined() on LangOptions. Repository: rG

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Nikita Popov via Phabricator via cfe-commits
nikic requested changes to this revision. nikic added a comment. This revision now requires changes to proceed. CreateConstArrayGEP currently always creates an inbounds GEP. You need to modify it make inbounds option / use a different method, not supress it in the constant folding

[PATCH] D142872: Honor the fwrapv option when generating the inbounds GEP .

2023-01-30 Thread Umesh Kalappa via Phabricator via cfe-commits
umesh.kalappa0 created this revision. umesh.kalappa0 added a reviewer: nikic. umesh.kalappa0 added a project: LLVM. Herald added subscribers: StephenFan, hiraditya. Herald added a project: All. umesh.kalappa0 requested review of this revision. Herald added a project: clang. Herald added