[llvm] b803957 - [SCEV][NFC] Call getExitCount with SymbolicMaximum when computing loop symbolic max

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 00:27:21 PST 2022


Author: Max Kazantsev
Date: 2022-11-22T15:27:14+07:00
New Revision: b803957bcee30762829343b762e41edf74c053f9

URL: https://github.com/llvm/llvm-project/commit/b803957bcee30762829343b762e41edf74c053f9
DIFF: https://github.com/llvm/llvm-project/commit/b803957bcee30762829343b762e41edf74c053f9.diff

LOG: [SCEV][NFC] Call getExitCount with SymbolicMaximum when computing loop symbolic max

Currently this is NFC, because SymbolicMaximum for BB is not implemented and just
reuses exact result. However, from code purity perspective, it's a necessary step
to do. Plans to implement symbolic max for blocks are underway.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index b7766992590f8..dd4fd89319451 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -14721,7 +14721,8 @@ ScalarEvolution::computeSymbolicMaxBackedgeTakenCount(const Loop *L) {
   // getConstantMaxBackedgeTakenCount which isn't restricted to just constants.
   SmallVector<const SCEV*, 4> ExitCounts;
   for (BasicBlock *ExitingBB : ExitingBlocks) {
-    const SCEV *ExitCount = getExitCount(L, ExitingBB);
+    const SCEV *ExitCount =
+        getExitCount(L, ExitingBB, ScalarEvolution::SymbolicMaximum);
     if (isa<SCEVCouldNotCompute>(ExitCount))
       ExitCount = getExitCount(L, ExitingBB,
                                   ScalarEvolution::ConstantMaximum);


        


More information about the llvm-commits mailing list