[llvm] feat: Scev predicated overflow btc and testing (PR #208581)

Bavly Peter via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 16:58:22 PDT 2026


================
@@ -13463,8 +13463,27 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
   ICmpInst::Predicate Cond = IsSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
 
   const SCEV *Stride = IV->getStepRecurrence(*this);
+  const SCEV *Start = IV->getStart();
----------------
bavly-bob wrote:

Note: this is not new logic; I moved the pointer normalization from below the if (!PositiveStride) block to before the overflow check. The normalization needs to happen before canIVOverflowOnLT() because the overflow analysis should operate on the integer representation of pointer SCEVs.

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


More information about the llvm-commits mailing list