[BranchProbabilityInfo] Use predecessors(BB) and successors(BB) (NFC)
authorKazu Hirata <kazu@google.com>
Mon, 16 Nov 2020 03:26:38 +0000 (19:26 -0800)
committerKazu Hirata <kazu@google.com>
Mon, 16 Nov 2020 03:26:38 +0000 (19:26 -0800)
llvm/lib/Analysis/BranchProbabilityInfo.cpp

index a3ab07f..a75001f 100644 (file)
@@ -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