[llvm] c5cc2d8 - [BranchProbabilityInfo] Use predecessors(BB) and successors(BB) (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 15 19:27:52 PST 2020
Author: Kazu Hirata
Date: 2020-11-15T19:26:38-08:00
New Revision: c5cc2d8b945a23e32613014b5de5d8d7f0c3cfe6
URL: https://github.com/llvm/llvm-project/commit/c5cc2d8b945a23e32613014b5de5d8d7f0c3cfe6
DIFF: https://github.com/llvm/llvm-project/commit/c5cc2d8b945a23e32613014b5de5d8d7f0c3cfe6.diff
LOG: [BranchProbabilityInfo] Use predecessors(BB) and successors(BB) (NFC)
Added:
Modified:
llvm/lib/Analysis/BranchProbabilityInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index a3ab07f60e4c..a75001ff5f98 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -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
More information about the llvm-commits
mailing list