[PATCH] D139818: [IndVars][NFCI] Avoid supposedly redundant query to save some CT

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 01:41:47 PST 2022


mkazantsev updated this revision to Diff 482032.
mkazantsev added a comment.

Fixed


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139818/new/

https://reviews.llvm.org/D139818

Files:
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp


Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1384,8 +1384,8 @@
   const SCEV *LHSS = SE->getSCEVAtScope(LHS, L);
   const SCEV *RHSS = SE->getSCEVAtScope(RHS, L);
   // Can we prove it to be trivially true or false?
-  if (auto EV = SE->evaluatePredicateAt(Pred, LHSS, RHSS, BI)) {
-    foldExit(L, ExitingBB, /*IsTaken*/ !*EV, DeadInsts);
+  if (SE->isKnownPredicateAt(Pred, LHSS, RHSS, BI)) {
+    foldExit(L, ExitingBB, /*IsTaken*/ false, DeadInsts);
     return true;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139818.482032.patch
Type: text/x-patch
Size: 659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/211599ee/attachment.bin>


More information about the llvm-commits mailing list