[llvm] [LAA][NFC] Refactor deref no-wrap check; expose broken reverse-loop bounds (PR #211960)

Aleksandr Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 05:58:22 PDT 2026


================
@@ -268,54 +276,60 @@ static bool evaluatePtrAddRecAtMaxBTCWillNotWrap(
   MaxBTC = SE.getNoopOrZeroExtend(MaxBTC, WiderTy);
 
   // For the computations below, make sure they don't unsigned wrap.
-  if (!SE.isKnownPredicate(CmpInst::ICMP_UGE, AR->getStart(), StartPtr))
+  // FIXME: for a negative step this holds the HIGHEST accessed address, not
+  // the lowest
+  const SCEV *LowestAddr = AR->getStart();
----------------
aleks-tmb wrote:

Agreed. I reverted StartOffset in this NFC patch and introduce the more specific name in the follow-up fix. Thanks!

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


More information about the llvm-commits mailing list