[VPlan] Add getPlan() to VPBlockBase.
authorFlorian Hahn <flo@fhahn.com>
Tue, 3 Mar 2020 10:28:53 +0000 (10:28 +0000)
committerFlorian Hahn <flo@fhahn.com>
Tue, 3 Mar 2020 13:20:13 +0000 (13:20 +0000)
commit05afa55521c8c88cdbed11aa834125f2cd4cfe65
tree08b4a41f0d3393edde741f21b5a05e5ecde48084
parent1d6fa41f40da5f5a615497eac818623779c46556
[VPlan] Add getPlan() to VPBlockBase.

This patch adds a getPlan accessor to VPBlockBase, which finds the entry
block of the plan containing the block and returns the plan set for this
block.

VPBlockBase contains a VPlan pointer, but it should only be set for
the entry block of a plan. This allows moving blocks without updating
the pointer for each moved block and in the future we might introduce a
parent relationship between plans and blocks, similar to the one in LLVM IR.

Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr

Reviewed By: gilr

Differential Revision: https://reviews.llvm.org/D74445
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanPredicatorTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp