[PATCH] D100175: [VPlan] Add GraphTraits impl to traverse through VPRegionBlock.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 04:00:57 PDT 2021


fhahn created this revision.
fhahn added reviewers: gilr, Ayal, sguggill, a.elovikov, rengolin.
Herald added subscribers: tschuett, psnobl, rogfer01, bollu, hiraditya.
fhahn requested review of this revision.
Herald added a subscriber: vkmr.
Herald added a project: LLVM.

This patch adds a new iterator to traverse through VPRegionBlocks and a
GraphTraits specialization using the iterator to traverse through
VPRegionBlocks.

Because there is already a GraphTraits specialization for VPBlockBase *
and co, a new VPBlockRecursiveTraversalWrapper helper is introduced.
This allows us to provide a new GraphTraits specialization for that
type. Users can use the new recursive traversal by using this wrapper.

The graph trait visits both the entry block of a region, as well as all
its successors. 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100175

Files:
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100175.336385.patch
Type: text/x-patch
Size: 10410 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210409/c766b3fd/attachment.bin>


More information about the llvm-commits mailing list