1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +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. /// getMax - Get the max backedge taken count for the loop.
const SCEV * const SCEV *
ScalarEvolution::BackedgeTakenInfo::getMax(ScalarEvolution *SE) const { ScalarEvolution::BackedgeTakenInfo::getMax(ScalarEvolution *SE) const {
// TODO: use any_of auto PredicateNotAlwaysTrue = [](const ExitNotTakenInfo &ENT) {
for (auto &ENT : ExitNotTaken) return !ENT.hasAlwaysTruePredicate();
if (!ENT.hasAlwaysTruePredicate()) };
return SE->getCouldNotCompute();
if (auto *Max = getMax()) if (any_of(ExitNotTaken, PredicateNotAlwaysTrue) || !getMax())
return Max; return SE->getCouldNotCompute();
return SE->getCouldNotCompute();
return getMax();
} }
bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S, bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S,