[llvm] fc986e3 - [SCEV][NFC] Call getConstantMaxBackedgeTakenCount once in printout

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 24 03:50:44 PST 2022


Author: Max Kazantsev
Date: 2022-11-24T18:48:30+07:00
New Revision: fc986e38d24f80c0a8525512945fe8d35b657674

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

LOG: [SCEV][NFC] Call getConstantMaxBackedgeTakenCount once in printout

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 6794d7e7b27d..7a7f85af3824 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -13368,9 +13368,9 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
   L->getHeader()->printAsOperand(OS, /*PrintType=*/false);
   OS << ": ";
 
-  if (!isa<SCEVCouldNotCompute>(SE->getConstantMaxBackedgeTakenCount(L))) {
-    OS << "constant max backedge-taken count is "
-       << *SE->getConstantMaxBackedgeTakenCount(L);
+  auto *ConstantBTC = SE->getConstantMaxBackedgeTakenCount(L);
+  if (!isa<SCEVCouldNotCompute>(ConstantBTC)) {
+    OS << "constant max backedge-taken count is " << *ConstantBTC;
     if (SE->isBackedgeTakenCountMaxOrZero(L))
       OS << ", actual taken count either this or zero.";
   } else {


        


More information about the llvm-commits mailing list