summaryrefslogtreecommitdiff
path: root/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2023-05-04 14:00:13 +0100
committerFlorian Hahn <flo@fhahn.com>2023-05-04 14:00:13 +0100
commitb85a402dd899fc0e702a60b459bc06317d532d84 (patch)
tree162dae8be206f10290545df7a33e650d60844bb6 /llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
parentf19f7497ca86f31152ef743ce98dc46469fda857 (diff)
[VPlan] Introduce new entry block to VPlan for early SCEV expansion.
This patch adds a new preheader block the VPlan to place SCEV expansions expansions like the trip count. This preheader block is disconnected at the moment, as the bypass blocks of the skeleton are not yet modeled in VPlan. The preheader block is executed before skeleton creation, so the SCEV expansion results can be used during skeleton creation. At the moment, the trip count expression and induction steps are expanded in the new preheader. The remainder of SCEV expansions will be moved gradually in the future. D147965 will update skeleton creation to use the steps expanded in the pre-header to fix #58811. Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D147964
Diffstat (limited to 'llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp')
-rw-r--r--llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp b/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
index 1e5d60b864c3..bb064b5f63b7 100644
--- a/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
@@ -24,6 +24,7 @@ TEST(VPDominatorTreeTest, DominanceNoRegionsTest) {
// \ /
// VPBB4
// }
+ VPBasicBlock *VPPH = new VPBasicBlock("ph");
VPBasicBlock *VPBB0 = new VPBasicBlock("VPBB0");
VPBasicBlock *VPBB1 = new VPBasicBlock("VPBB1");
VPBasicBlock *VPBB2 = new VPBasicBlock("VPBB2");
@@ -39,8 +40,8 @@ TEST(VPDominatorTreeTest, DominanceNoRegionsTest) {
VPBlockUtils::connectBlocks(VPBB2, VPBB4);
VPBlockUtils::connectBlocks(VPBB3, VPBB4);
- VPlan Plan;
- Plan.setEntry(VPBB0);
+ auto TC = std::make_unique<VPValue>();
+ VPlan Plan(VPPH, &*TC, VPBB0);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);
@@ -90,6 +91,7 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
// R2BB2
// }
//
+ VPBasicBlock *VPPH = new VPBasicBlock("ph");
VPBasicBlock *VPBB0 = new VPBasicBlock("VPBB0");
VPBasicBlock *R1BB1 = new VPBasicBlock();
VPBasicBlock *R1BB2 = new VPBasicBlock();
@@ -112,8 +114,8 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
VPBlockUtils::connectBlocks(R2BB1, R2BB2);
VPBlockUtils::connectBlocks(R1, R2);
- VPlan Plan;
- Plan.setEntry(VPBB0);
+ auto TC = std::make_unique<VPValue>();
+ VPlan Plan(VPPH, &*TC, VPBB0);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);
@@ -165,6 +167,7 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
// |
// VPBB2
//
+ VPBasicBlock *VPPH = new VPBasicBlock("ph");
VPBasicBlock *R1BB1 = new VPBasicBlock("R1BB1");
VPBasicBlock *R1BB2 = new VPBasicBlock("R1BB2");
VPBasicBlock *R1BB3 = new VPBasicBlock("R1BB3");
@@ -191,8 +194,8 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
VPBasicBlock *VPBB2 = new VPBasicBlock("VPBB2");
VPBlockUtils::connectBlocks(R1, VPBB2);
- VPlan Plan;
- Plan.setEntry(VPBB1);
+ auto TC = std::make_unique<VPValue>();
+ VPlan Plan(VPPH, &*TC, VPBB1);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);