[llvm] [SeparateConstOffsetFromGEP] Preserve inbounds flag based on ValueTracking and NUW (PR #130617)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 01:36:53 PDT 2025


================
@@ -778,17 +780,45 @@ Value *ConstantOffsetExtractor::removeConstOffset(unsigned ChainIndex) {
   return NewBO;
 }
 
+/// A helper function to check if reassociating through an entry in the user
+/// chain would invalidate the GEP's nuw flag.
+static bool allowsPreservingNUW(User *U) {
----------------
arsenm wrote:

```suggestion
static bool allowsPreservingNUW(const User &U) {
```

https://github.com/llvm/llvm-project/pull/130617


More information about the llvm-commits mailing list