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.
|
/// 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,
|
||||||
|
Loading…
Reference in New Issue
Block a user