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

Fabian Ritter via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 23 01:28:06 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) {
----------------
ritter-x2a wrote:

Does that work for you, @arsenm ?

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


More information about the llvm-commits mailing list