mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[BranchProbabilityInfo] Use predecessors(BB) and successors(BB) (NFC)
This commit is contained in:
parent
ec77f903c9
commit
b19e46e051
@ -220,17 +220,16 @@ void BranchProbabilityInfo::SccInfo::calculateSccBlockType(const BasicBlock *BB,
|
||||
assert(getSCCNum(BB) == SccNum);
|
||||
uint32_t BlockType = Inner;
|
||||
|
||||
if (llvm::any_of(make_range(pred_begin(BB), pred_end(BB)),
|
||||
[&](const BasicBlock *Pred) {
|
||||
if (llvm::any_of(predecessors(BB), [&](const BasicBlock *Pred) {
|
||||
// Consider any block that is an entry point to the SCC as
|
||||
// a header.
|
||||
return getSCCNum(Pred) != SccNum;
|
||||
}))
|
||||
BlockType |= Header;
|
||||
|
||||
if (llvm::any_of(
|
||||
make_range(succ_begin(BB), succ_end(BB)),
|
||||
[&](const BasicBlock *Succ) { return getSCCNum(Succ) != SccNum; }))
|
||||
if (llvm::any_of(successors(BB), [&](const BasicBlock *Succ) {
|
||||
return getSCCNum(Succ) != SccNum;
|
||||
}))
|
||||
BlockType |= Exiting;
|
||||
|
||||
// Lazily compute the set of headers for a given SCC and cache the results
|
||||
|
Loading…
Reference in New Issue
Block a user