[llvm] 58cfa39 - [VPlan] Remove legacy VPlan() constructors (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 00:23:55 PST 2024
Author: Florian Hahn
Date: 2024-12-17T08:22:22Z
New Revision: 58cfa39861bfbb6605df1480a3068ea7fc737d4d
URL: https://github.com/llvm/llvm-project/commit/58cfa39861bfbb6605df1480a3068ea7fc737d4d
DIFF: https://github.com/llvm/llvm-project/commit/58cfa39861bfbb6605df1480a3068ea7fc737d4d.diff
LOG: [VPlan] Remove legacy VPlan() constructors (NFC).
The constructors were retained to reduce the diff during transition.
Remove them now.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 432030a7b1adf3..ca8614ba7da1fd 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -821,18 +821,6 @@ void VPRegionBlock::print(raw_ostream &O, const Twine &Indent,
}
#endif
-VPlan::VPlan(VPBasicBlock *OriginalPreheader, VPValue *TC,
- VPBasicBlock *EntryVectorPreHeader, VPIRBasicBlock *ScalarHeader)
- : VPlan(OriginalPreheader, TC, ScalarHeader) {
- VPBlockUtils::connectBlocks(OriginalPreheader, EntryVectorPreHeader);
-}
-
-VPlan::VPlan(VPBasicBlock *OriginalPreheader,
- VPBasicBlock *EntryVectorPreHeader, VPIRBasicBlock *ScalarHeader)
- : VPlan(OriginalPreheader, ScalarHeader) {
- VPBlockUtils::connectBlocks(OriginalPreheader, EntryVectorPreHeader);
-}
-
VPlan::~VPlan() {
if (Entry) {
VPValue DummyValue;
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 790566113fef5c..32db42a4937b43 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -3832,14 +3832,6 @@ class VPlan {
TripCount = TC;
}
- /// Constructor variants that take disconnected preheader and entry blocks,
- /// connecting them as part of construction.
- /// FIXME: Only used to reduce the need of code changes during transition.
- VPlan(VPBasicBlock *OriginalPreheader, VPValue *TC,
- VPBasicBlock *EntryVectorPreHeader, VPIRBasicBlock *ScalarHeader);
- VPlan(VPBasicBlock *OriginalPreheader, VPBasicBlock *EntryVectorPreHeader,
- VPIRBasicBlock *ScalarHeader);
-
/// Construct a VPlan with \p Entry to the plan and with \p ScalarHeader
/// wrapping the original header of the scalar loop.
VPlan(VPBasicBlock *Entry, VPIRBasicBlock *ScalarHeader)
diff --git a/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp b/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
index 86182ccae0b55b..55cbe83b85c62d 100644
--- a/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPDomTreeTest.cpp
@@ -45,7 +45,8 @@ TEST(VPDominatorTreeTest, DominanceNoRegionsTest) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB0, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB0);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);
@@ -125,7 +126,8 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB0, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB0);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);
@@ -207,7 +209,8 @@ TEST(VPDominatorTreeTest, DominanceRegionsTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
VPDominatorTree VPDT;
VPDT.recalculate(Plan);
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
index bc8bcc3447ea0a..97a1f8150beff2 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
@@ -260,7 +260,8 @@ TEST(VPBasicBlockTest, getPlan) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB4, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
EXPECT_EQ(&Plan, VPBB1->getPlan());
EXPECT_EQ(&Plan, VPBB2->getPlan());
@@ -282,7 +283,8 @@ TEST(VPBasicBlockTest, getPlan) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
EXPECT_EQ(&Plan, VPBB1->getPlan());
EXPECT_EQ(&Plan, R1->getPlan());
@@ -314,7 +316,8 @@ TEST(VPBasicBlockTest, getPlan) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
EXPECT_EQ(&Plan, VPBB1->getPlan());
EXPECT_EQ(&Plan, R1->getPlan());
@@ -360,7 +363,8 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB4, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
}
{
@@ -462,7 +466,8 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB0, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB0);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
}
{
@@ -547,7 +552,8 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
}
{
@@ -597,7 +603,8 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
}
{
@@ -691,7 +698,8 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
auto TC = std::make_unique<VPValue>();
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB2, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
}
delete ScalarHeader;
}
@@ -734,7 +742,8 @@ TEST(VPBasicBlockTest, print) {
auto *ScalarHeader = BasicBlock::Create(C, "scalar.header");
auto * ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB2, ScalarHeaderVPBB);
- VPlan Plan(VPBB0, TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPBB0, VPBB1);
+ VPlan Plan(VPBB0, TC, ScalarHeaderVPBB);
std::string FullDump;
raw_string_ostream OS(FullDump);
Plan.printDOT(OS);
@@ -827,7 +836,8 @@ TEST(VPBasicBlockTest, printPlanWithVFsAndUFs) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB1, ScalarHeaderVPBB);
- VPlan Plan(VPBB0, TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPBB0, VPBB1);
+ VPlan Plan(VPBB0, TC, ScalarHeaderVPBB);
Plan.setName("TestPlan");
Plan.addVF(ElementCount::getFixed(4));
@@ -1301,7 +1311,8 @@ TEST(VPRecipeTest, dumpRecipeInPlan) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB1, ScalarHeaderVPBB);
- VPlan Plan(VPBB0, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPBB0, VPBB1);
+ VPlan Plan(VPBB0, ScalarHeaderVPBB);
IntegerType *Int32 = IntegerType::get(C, 32);
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
@@ -1373,7 +1384,8 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(VPBB1, ScalarHeaderVPBB);
- VPlan Plan(VPBB0, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPBB0, VPBB1);
+ VPlan Plan(VPBB0, ScalarHeaderVPBB);
IntegerType *Int32 = IntegerType::get(C, 32);
auto *AI = BinaryOperator::CreateAdd(PoisonValue::get(Int32),
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
index bc4f3943447fde..570d202f738c05 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
@@ -33,7 +33,8 @@ TEST(VPVerifierTest, VPInstructionUseBeforeDefSameBB) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
#if GTEST_HAS_STREAM_REDIRECTION
::testing::internal::CaptureStderr();
@@ -70,7 +71,8 @@ TEST(VPVerifierTest, VPInstructionUseBeforeDefDifferentBB) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
#if GTEST_HAS_STREAM_REDIRECTION
::testing::internal::CaptureStderr();
@@ -117,7 +119,8 @@ TEST(VPVerifierTest, VPBlendUseBeforeDefDifferentBB) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
#if GTEST_HAS_STREAM_REDIRECTION
::testing::internal::CaptureStderr();
@@ -158,7 +161,8 @@ TEST(VPVerifierTest, DuplicateSuccessorsOutsideRegion) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
#if GTEST_HAS_STREAM_REDIRECTION
::testing::internal::CaptureStderr();
@@ -200,7 +204,8 @@ TEST(VPVerifierTest, DuplicateSuccessorsInsideRegion) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
#if GTEST_HAS_STREAM_REDIRECTION
::testing::internal::CaptureStderr();
@@ -233,7 +238,8 @@ TEST(VPVerifierTest, BlockOutsideRegionWithParent) {
auto *ScalarHeader = BasicBlock::Create(C, "");
VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock(ScalarHeader);
VPBlockUtils::connectBlocks(R1, ScalarHeaderVPBB);
- VPlan Plan(VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
+ VPBlockUtils::connectBlocks(VPPH, VPBB1);
+ VPlan Plan(VPPH, &*TC, ScalarHeaderVPBB);
VPBB1->setParent(R1);
#if GTEST_HAS_STREAM_REDIRECTION
More information about the llvm-commits
mailing list