[PATCH] D63733: [IndVars] Use exit count reasoning to discharge obviously untaken exits
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 5 17:03:35 PDT 2019
jdoerfert added a comment.
Some minor comments. Generally this makes sense but someone else should probably take a look as well.
================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:2681
+ if (ExitCount->isZero()) {
+ auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
+ bool ExitIfTrue = !L->contains(*succ_begin(ExitingBB));
----------------
BI, with this definition, is already available.
================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:2709
+ MaxExitCount, ExitCount)) {
+ auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
+ bool ExitIfTrue = !L->contains(*succ_begin(ExitingBB));
----------------
Same as above.
================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:2717
+ DeadInsts.push_back(OldCond);
+ Changed = true;
+ continue;
----------------
Same (non-trivial) code as above, could we extract it somehow?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63733/new/
https://reviews.llvm.org/D63733
More information about the llvm-commits
mailing list