Skip to content

Commit 6e1308b

Browse files
committed
[SCEV][NFC] Simplify check with CI->isZero() exit condition
Replace check with if ((ExitIfTrue && CI->isZero()) || (!ExitIfTrue && CI->isOne())) with equivalent and simpler version if (ExitIfTrue == CI->isZero())
1 parent 46a1dd4 commit 6e1308b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7829,7 +7829,7 @@ ScalarEvolution::computeBackedgeTakenCount(const Loop *L,
78297829
if (auto *BI = dyn_cast<BranchInst>(ExitBB->getTerminator()))
78307830
if (auto *CI = dyn_cast<ConstantInt>(BI->getCondition())) {
78317831
bool ExitIfTrue = !L->contains(BI->getSuccessor(0));
7832-
if ((ExitIfTrue && CI->isZero()) || (!ExitIfTrue && CI->isOne()))
7832+
if (ExitIfTrue == CI->isZero())
78337833
continue;
78347834
}
78357835

0 commit comments

Comments
 (0)