[llvm] [VPlan] Generalize `VPAllSuccessorsIterator` to support predecessors (PR #178724)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 04:51:36 PST 2026


================
@@ -25,90 +25,132 @@ namespace llvm {
 // GraphTraits specializations for VPlan Hierarchical Control-Flow Graphs     //
 //===----------------------------------------------------------------------===//
 
-/// Iterator to traverse all successors of a VPBlockBase node. This includes the
-/// entry node of VPRegionBlocks. Exit blocks of a region implicitly have their
-/// parent region's successors. This ensures all blocks in a region are visited
-/// before any blocks in a successor region when doing a reverse post-order
-// traversal of the graph. Region blocks themselves traverse only their entries
-// directly and not their successors. Those will be traversed when a region's
-// exiting block is traversed
-template <typename BlockPtrTy>
-class VPAllSuccessorsIterator
-    : public iterator_facade_base<VPAllSuccessorsIterator<BlockPtrTy>,
-                                  std::bidirectional_iterator_tag,
-                                  VPBlockBase> {
+/// Iterator to traverse all successors/predecessors of a VPBlockBase node, such
----------------
fhahn wrote:

nit: would be good to clarify that this includes hierarchical successors/predecessors

```suggestion
/// Iterator to traverse all successors/predecessors of a VPBlockBase node, including its hierarchical successors/predecessors. For example:
```

https://github.com/llvm/llvm-project/pull/178724


More information about the llvm-commits mailing list