Skip to content

Commit 46a1dd4

Browse files
committed
[SCEV][NFC] Reorder checks to delay call of all_of
Check lightweight getter condition before calling all_of.
1 parent 60605a2 commit 46a1dd4

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
@@ -7681,7 +7681,7 @@ ScalarEvolution::BackedgeTakenInfo::getConstantMax(ScalarEvolution *SE) const {
76817681
return !ENT.hasAlwaysTruePredicate();
76827682
};
76837683

7684-
if (any_of(ExitNotTaken, PredicateNotAlwaysTrue) || !getConstantMax())
7684+
if (!getConstantMax() || any_of(ExitNotTaken, PredicateNotAlwaysTrue))
76857685
return SE->getCouldNotCompute();
76867686

76877687
assert((isa<SCEVCouldNotCompute>(getConstantMax()) ||

0 commit comments

Comments
 (0)