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:
parent
16ec3916da
commit
2025c6e5ef
@ -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())
|
||||
auto PredicateNotAlwaysTrue = [](const ExitNotTakenInfo &ENT) {
|
||||
return !ENT.hasAlwaysTruePredicate();
|
||||
};
|
||||
|
||||
if (any_of(ExitNotTaken, PredicateNotAlwaysTrue) || !getMax())
|
||||
return SE->getCouldNotCompute();
|
||||
|
||||
if (auto *Max = getMax())
|
||||
return Max;
|
||||
return SE->getCouldNotCompute();
|
||||
return getMax();
|
||||
}
|
||||
|
||||
bool ScalarEvolution::BackedgeTakenInfo::hasOperand(const SCEV *S,
|
||||
|
Loading…
Reference in New Issue
Block a user