[llvm] [WIP][ScalarEvolution] Replace getSCEV call with computeConstantRange (PR #152769)

Danila Malyutin via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 14:04:11 PDT 2025


================
@@ -6945,7 +6945,16 @@ const ConstantRange &ScalarEvolution::getRangeRef(
         ConstantRange RangeFromOps(BitWidth, /*isFullSet=*/false);
 
         for (const auto &Op : Phi->operands()) {
-          auto OpRange = getRangeRef(getSCEV(Op), SignHint, Depth + 1);
+          ConstantRange OpRange = RangeFromOps;
+          if (auto *S = getExistingSCEV(Op)) {
+            OpRange = getRangeRef(S, SignHint, Depth + 1);
+          } else {
+            if (!Op->getType()->isIntOrIntVectorTy())
+              break;
+            SimplifyQuery SQ(DL, &DT, &AC, Phi, true);
----------------
danilaml wrote:

Looks like some polly lit tests are failing?

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


More information about the llvm-commits mailing list