mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 13:40:30 +00:00
Minor clean up in loopHasNoAbnormalExits; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05c5b3fd8e
commit
0c3d257062
@ -4912,15 +4912,14 @@ bool ScalarEvolution::isAddRecNeverPoison(const Instruction *I, const Loop *L) {
|
||||
bool ScalarEvolution::loopHasNoAbnormalExits(const Loop *L) {
|
||||
auto Itr = LoopHasNoAbnormalExits.find(L);
|
||||
if (Itr == LoopHasNoAbnormalExits.end()) {
|
||||
bool HasAbnormalExit = false;
|
||||
for (auto *BB : L->getBlocks()) {
|
||||
HasAbnormalExit = any_of(*BB, [](Instruction &I) {
|
||||
return !isGuaranteedToTransferExecutionToSuccessor(&I);
|
||||
auto NoAbnormalExitInBB = [&](BasicBlock *BB) {
|
||||
return all_of(*BB, [](Instruction &I) {
|
||||
return isGuaranteedToTransferExecutionToSuccessor(&I);
|
||||
});
|
||||
if (HasAbnormalExit)
|
||||
break;
|
||||
}
|
||||
auto InsertPair = LoopHasNoAbnormalExits.insert({L, !HasAbnormalExit});
|
||||
};
|
||||
|
||||
auto InsertPair = LoopHasNoAbnormalExits.insert(
|
||||
{L, all_of(L->getBlocks(), NoAbnormalExitInBB)});
|
||||
assert(InsertPair.second && "We just checked!");
|
||||
Itr = InsertPair.first;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user