Skip to content

Commit

Permalink
[Analysis] Use llvm::children and llvm::inverse_children (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Jan 20, 2024
1 parent df017dc commit 17a777a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1532,8 +1532,7 @@ void BlockFrequencyInfoImpl<BT>::findReachableBlocks(
SmallPtrSet<const BlockT *, 8> InverseReachable;
for (const BlockT &BB : *F) {
// An exit block is a block without any successors
bool HasSucc = GraphTraits<const BlockT *>::child_begin(&BB) !=
GraphTraits<const BlockT *>::child_end(&BB);
bool HasSucc = !llvm::children<const BlockT *>(&BB).empty();
if (!HasSucc && Reachable.count(&BB)) {
Queue.push(&BB);
InverseReachable.insert(&BB);
Expand All @@ -1542,7 +1541,7 @@ void BlockFrequencyInfoImpl<BT>::findReachableBlocks(
while (!Queue.empty()) {
const BlockT *SrcBB = Queue.front();
Queue.pop();
for (const BlockT *DstBB : children<Inverse<const BlockT *>>(SrcBB)) {
for (const BlockT *DstBB : inverse_children<const BlockT *>(SrcBB)) {
auto EP = BPI->getEdgeProbability(DstBB, SrcBB);
if (EP.isZero())
continue;
Expand Down

0 comments on commit 17a777a

Please sign in to comment.