[PATCH] D87344: [IndVars] Remove exiting conditions that are trivially true/false
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 02:43:46 PDT 2020
lebedev.ri added a comment.
This looks about reasonable to me, but i don't feel confident reviewing this.
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2348-2352
+ // Can we prove it to be trivially true?
+ if (SE->isKnownPredicate(Pred, LHSS, RHSS))
+ return true;
+
+ return false;
----------------
Should this just be `return SE->isKnownPredicate(Pred, LHSS, RHSS);`,
or are there some other changes planned?
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2376
- const SCEV *ExitCount = SE->getExitCount(L, ExitingBB);
- if (isa<SCEVCouldNotCompute>(ExitCount))
+ if (!DT->dominates(ExitingBB, L->getLoopLatch()))
return true;
----------------
// Likewise, the loop latch must be dominated by the exiting BB.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87344/new/
https://reviews.llvm.org/D87344
More information about the llvm-commits
mailing list