[llvm] 17a777a - [Analysis] Use llvm::children and llvm::inverse_children (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 22:24:29 PST 2024


Author: Kazu Hirata
Date: 2024-01-19T22:24:16-08:00
New Revision: 17a777a4a5863bfe5bb1c2602486d6ca9bfb0199

URL: https://github.com/llvm/llvm-project/commit/17a777a4a5863bfe5bb1c2602486d6ca9bfb0199
DIFF: https://github.com/llvm/llvm-project/commit/17a777a4a5863bfe5bb1c2602486d6ca9bfb0199.diff

LOG: [Analysis] Use llvm::children and llvm::inverse_children (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
index 0c05be0b9b8cdf1..8acb75e8725410c 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -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);
@@ -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;


        


More information about the llvm-commits mailing list