1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[SCEV] Simplify BackedgeTakenInfo::getMax; NFC

llvm-svn: 282372
This commit is contained in:
Sanjoy Das 2016-09-26 01:10:22 +00:00
parent 16ec3916da
commit 2025c6e5ef

View File

@ -5640,14 +5640,14 @@ ScalarEvolution::BackedgeTakenInfo::getExact(BasicBlock *ExitingBlock,
/// getMax - Get the max backedge taken count for the loop.
const SCEV *
ScalarEvolution::BackedgeTakenInfo::getMax(ScalarEvolution *SE) const {
// TODO: use any_of
for (auto &ENT : ExitNotTaken)
if (!ENT.hasAlwaysTruePredicate())
return SE->getCouldNotCompute();
auto PredicateNotAlwaysTrue = [](const ExitNotTakenInfo &ENT) {
return !ENT.hasAlwaysTruePredicate();
};
if (auto *Max = getMax())
return Max;
return SE->getCouldNotCompute();
if (any_of(ExitNotTaken, PredicateNotAlwaysTrue) || !getMax())
return SE->getCouldNotCompute();
return getMax();
}
bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S,