[VPlan] Switch default graph traits to be recursive, update VPDomTree.
authorFlorian Hahn <flo@fhahn.com>
Mon, 23 Jan 2023 14:00:42 +0000 (14:00 +0000)
committerFlorian Hahn <flo@fhahn.com>
Mon, 23 Jan 2023 14:00:43 +0000 (14:00 +0000)
commitbf9e0da1a5fcb3a850c8aa1686bd38888261b065
tree03401d7d6101ca7919e7287f70b0a82414c0408e
parent5a7f47cc021bd7a19cb70c9a30755d6b3cb67431
[VPlan] Switch default graph traits to be recursive, update VPDomTree.

This updates the GraphTraits specialization for VPBlockBase to recurse
through VPRegionBlocks.

This in turn enables using VPDominatorTree to query dominance between
any block in a plan. This should enable additional use cases, including
improvements to def-use verification and porting IR-based transforms
that rely on the dominator tree.

Specifically, this change means that for regions, the entry and exit
blocks dominate the successors of the region.

Depends on D140512 and D142162.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D140513
llvm/lib/Transforms/Vectorize/VPlanCFG.h
llvm/lib/Transforms/Vectorize/VPlanDominatorTree.h
llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp