[VPlan] Update unit tests to use getVectorLoopRegion (NFC).
Use getVectorLoopRegion to retrieve the vector loop header instead of
relying on getting the successor of the entry block. This makes sure the
code still works correctly as more parts of the skeleton are modeled in
VPlan.
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
index 00a3c73..01d6301 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
@@ -50,7 +50,7 @@
// Check that the region following the preheader is a single basic-block
// region (loop).
- VPBasicBlock *VecBB = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *VecBB = Plan->getVectorLoopRegion()->getEntryBasicBlock();
EXPECT_EQ(8u, VecBB->size());
EXPECT_EQ(0u, VecBB->getNumPredecessors());
EXPECT_EQ(0u, VecBB->getNumSuccessors());
@@ -193,7 +193,7 @@
// Check that the region following the preheader is a single basic-block
// region (loop).
- VPBasicBlock *VecBB = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *VecBB = Plan->getVectorLoopRegion()->getEntryBasicBlock();
EXPECT_EQ(8u, VecBB->size());
EXPECT_EQ(0u, VecBB->getNumPredecessors());
EXPECT_EQ(0u, VecBB->getNumSuccessors());
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
index 910fc24..1b993b6 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
@@ -99,7 +99,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 12));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 14));
@@ -171,7 +171,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 12));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 14));
@@ -243,7 +243,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 8));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 10));
@@ -307,7 +307,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 5));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 10));
@@ -444,7 +444,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 24));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 26));
@@ -516,7 +516,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 24));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 26));
@@ -588,7 +588,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 24));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 26));
@@ -664,7 +664,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 24));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 26));
@@ -725,7 +725,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPBasicBlock *BB2 = Body->getSingleSuccessor()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(BB2->begin(), 3));
@@ -788,7 +788,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPBasicBlock *BB2 = Body->getSingleSuccessor()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(BB2->begin(), 1));
@@ -848,7 +848,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 12));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 14));
@@ -907,7 +907,7 @@
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
EXPECT_NE(nullptr, Entry->getSingleSuccessor());
- VPBasicBlock *Body = Entry->getSingleSuccessor()->getEntryBasicBlock();
+ VPBasicBlock *Body = Plan->getVectorLoopRegion()->getEntryBasicBlock();
VPInstruction *Store1 = cast<VPInstruction>(&*std::next(Body->begin(), 12));
VPInstruction *Store2 = cast<VPInstruction>(&*std::next(Body->begin(), 14));