[all-commits] [llvm/llvm-project] 89c4dd: [VPlan] Add GraphTraits impl to traverse through V...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Apr 23 09:27:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89c4dda076e29bb085426a621ea5797ced599f03
      https://github.com/llvm/llvm-project/commit/89c4dda076e29bb085426a621ea5797ced599f03
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-04-23 (Fri, 23 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

  Log Message:
  -----------
  [VPlan] Add GraphTraits impl to traverse through VPRegionBlock.

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.

Reviewed By: a.elovikov

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




More information about the All-commits mailing list