[BPI] Push exit block rather than exiting ones in getSccExitBlocks
authorBin Cheng <bin.cheng@linux.alibaba.com>
Sat, 6 Nov 2021 11:26:39 +0000 (19:26 +0800)
committerBin Cheng <bin.cheng@linux.alibaba.com>
Thu, 11 Nov 2021 06:22:19 +0000 (14:22 +0800)
The function BranchProbabilityInfo::SccInfo::getSccExitBlocks is
supposed to collect all exit blocks for SCC rather than all exiting
blocks. This patch fixes the typo.

Reviewed By: ebrevnov

Differential Revision: https://reviews.llvm.org/D113344

llvm/lib/Analysis/BranchProbabilityInfo.cpp

index aa6b93fe3f07c54f5b0a71cf6eb5a4bf1de587bf..33fdc8b628c59f1f86dd948173b7da71754dc58b 100644 (file)
@@ -190,7 +190,7 @@ void BranchProbabilityInfo::SccInfo::getSccExitBlocks(
     if (isSCCExitingBlock(BB, SccNum))
       for (const auto *Succ : successors(BB))
         if (getSCCNum(Succ) != SccNum)
-          Exits.push_back(const_cast<BasicBlock *>(BB));
+          Exits.push_back(const_cast<BasicBlock *>(Succ));
   }
 }