[llvm] [SCEV] Add option to request use-specific SCEV for a GEP expr, (PR #190677)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 08:27:30 PDT 2026


================
@@ -3967,6 +3970,30 @@ const SCEV *ScalarEvolution::getGEPExpr(SCEVUse BaseExpr,
   auto *GEPExpr = getAddExpr(BaseExpr, Offset, BaseWrap);
   assert(BaseExpr->getType() == GEPExpr->getType() &&
          "GEP should not change type mid-flight.");
+  if (!NUW) {
+    if (UseSpecificNW.hasNoUnsignedWrap() ||
+        (UseSpecificNW.isInBounds() && isKnownNonNegative(Offset))) {
----------------
fhahn wrote:

updated thanks

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


More information about the llvm-commits mailing list