Revert "[NFC] Factor away lambda's redundant parameter"

This reverts commit fdc845b361.
It seems to be a follow-up to c6372b3fb495 which will be reverted.
This commit is contained in:
Raphael Isemann 2020-10-27 13:37:16 +01:00
parent 75a1790f4b
commit a0d84d8031
1 changed files with 4 additions and 3 deletions

View File

@ -2429,14 +2429,15 @@ bool IndVarSimplify::optimizeLoopExits(Loop *L, SCEVExpander &Rewriter) {
// Okay, we do not know the exit count here. Can we at least prove that it
// will remain the same within iteration space?
auto *BI = cast<BranchInst>(ExitingBB->getTerminator());
auto OptimizeCond = [&](bool Inverted) {
if (isTrivialCond(L, BI, SE, Inverted, MaxExitCount)) {
auto OptimizeCond = [&](bool Inverted, const SCEV *MaxIter) {
if (isTrivialCond(L, BI, SE, Inverted, MaxIter)) {
FoldExit(ExitingBB, Inverted);
return true;
}
return false;
};
if (OptimizeCond(false) || OptimizeCond(true))
if (OptimizeCond(false, MaxExitCount) ||
OptimizeCond(true, MaxExitCount))
Changed = true;
continue;
}