[llvm] [ConstraintElim] Use constraints from bounded memory accesses (PR #155253)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 09:59:25 PDT 2025


================
@@ -1109,10 +1113,43 @@ void State::addInfoForInductions(BasicBlock &BB) {
   }
 }
 
+static bool getConstraintFromMemoryAccess(GetElementPtrInst &GEP,
+                                          uint64_t AccessSize,
+                                          CmpPredicate &Pred, Value *&A,
+                                          Value *&B, const DataLayout &DL,
+                                          const TargetLibraryInfo &TLI) {
+  auto Offset = collectOffsets(cast<GEPOperator>(GEP), DL);
+  if (!Offset.NW.isInBounds())
----------------
dtcxzyw wrote:

It works with `nuw` or `nusw + nneg idx`: https://alive2.llvm.org/ce/z/JEyjA2 https://alive2.llvm.org/ce/z/umu4GJ

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


More information about the llvm-commits mailing list