[llvm] [WIP][ScalarEvolution] Replace getSCEV call with computeConstantRange (PR #152769)
    Nikita Popov via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Aug  8 11:52:55 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)) {
----------------
nikic wrote:
Hm, using getExistingSCEV here is going to make results even more query-order dependent than they already are. We can see this in how the `print<scalar-evolution>` results all get better, while the actual transform changes are all worse.
https://github.com/llvm/llvm-project/pull/152769
    
    
More information about the llvm-commits
mailing list