[llvm] [SCEV] Use computeMaxBECountForLT for howManyGreaterThans. (PR #224863)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 02:23:52 PDT 2026


================
@@ -13350,9 +13326,9 @@ const SCEV *ScalarEvolution::computeMaxBECountForLT(const SCEV *Start,
     return getCouldNotCompute();
 
   // Calculate the maximum backedge count based on the range of values
-  // permitted by Start, End, and Stride.
-  APInt MinStart =
-      IsSigned ? getSignedRangeMin(Start) : getUnsignedRangeMin(Start);
+  // permitted by Start, End, and Stride. If Invert is true, both Start and End
+  // need inverting. Stride is already inverted by the caller.
----------------
nikic wrote:

I meant that Start/End need to be inverted (~), while Stride was already negated (-).

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


More information about the llvm-commits mailing list