@@ -259,6 +259,7 @@ TEST(VPBasicBlockTest, getPlan) {
259259
260260 auto TC = std::make_unique<VPValue>();
261261 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
262+ VPBlockUtils::connectBlocks (VPBB4, ScalarHeaderVPBB);
262263 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
263264
264265 EXPECT_EQ (&Plan, VPBB1->getPlan ());
@@ -280,6 +281,7 @@ TEST(VPBasicBlockTest, getPlan) {
280281
281282 auto TC = std::make_unique<VPValue>();
282283 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
284+ VPBlockUtils::connectBlocks (R1, ScalarHeaderVPBB);
283285 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
284286
285287 EXPECT_EQ (&Plan, VPBB1->getPlan ());
@@ -311,6 +313,7 @@ TEST(VPBasicBlockTest, getPlan) {
311313
312314 auto TC = std::make_unique<VPValue>();
313315 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
316+ VPBlockUtils::connectBlocks (R2, ScalarHeaderVPBB);
314317 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
315318
316319 EXPECT_EQ (&Plan, VPBB1->getPlan ());
@@ -355,6 +358,7 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
355358 // Use Plan to properly clean up created blocks.
356359 auto TC = std::make_unique<VPValue>();
357360 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
361+ VPBlockUtils::connectBlocks (VPBB4, ScalarHeaderVPBB);
358362 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
359363 }
360364
@@ -456,6 +460,7 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
456460 // Use Plan to properly clean up created blocks.
457461 auto TC = std::make_unique<VPValue>();
458462 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
463+ VPBlockUtils::connectBlocks (R2, ScalarHeaderVPBB);
459464 VPlan Plan (VPPH, &*TC, VPBB0, ScalarHeaderVPBB);
460465 }
461466
@@ -540,6 +545,7 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
540545 // Use Plan to properly clean up created blocks.
541546 auto TC = std::make_unique<VPValue>();
542547 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
548+ VPBlockUtils::connectBlocks (VPBB2, ScalarHeaderVPBB);
543549 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
544550 }
545551
@@ -589,6 +595,7 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
589595 // Use Plan to properly clean up created blocks.
590596 auto TC = std::make_unique<VPValue>();
591597 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
598+ VPBlockUtils::connectBlocks (R1, ScalarHeaderVPBB);
592599 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
593600 }
594601
@@ -682,6 +689,7 @@ TEST(VPBasicBlockTest, TraversingIteratorTest) {
682689 // Use Plan to properly clean up created blocks.
683690 auto TC = std::make_unique<VPValue>();
684691 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
692+ VPBlockUtils::connectBlocks (VPBB2, ScalarHeaderVPBB);
685693 VPlan Plan (VPPH, &*TC, VPBB1, ScalarHeaderVPBB);
686694 }
687695}
@@ -808,6 +816,7 @@ TEST(VPBasicBlockTest, printPlanWithVFsAndUFs) {
808816 LLVMContext C;
809817 auto ScalarHeader = std::make_unique<BasicBlock *>(BasicBlock::Create (C, " " ));
810818 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
819+ VPBlockUtils::connectBlocks (VPBB1, ScalarHeaderVPBB);
811820 VPlan Plan (VPBB0, TC, VPBB1, ScalarHeaderVPBB);
812821 Plan.setName (" TestPlan" );
813822 Plan.addVF (ElementCount::getFixed (4 ));
@@ -826,6 +835,9 @@ No successors
826835
827836bb1:
828837 EMIT vp<%2> = add
838+ Successor(s): ir-bb<>
839+
840+ ir-bb<>:
829841No successors
830842}
831843)" ;
@@ -847,6 +859,9 @@ No successors
847859
848860bb1:
849861 EMIT vp<%2> = add
862+ Successor(s): ir-bb<>
863+
864+ ir-bb<>:
850865No successors
851866}
852867)" ;
@@ -868,6 +883,9 @@ No successors
868883
869884bb1:
870885 EMIT vp<%2> = add
886+ Successor(s): ir-bb<>
887+
888+ ir-bb<>:
871889No successors
872890}
873891)" ;
@@ -1271,6 +1289,7 @@ TEST(VPRecipeTest, dumpRecipeInPlan) {
12711289 LLVMContext C;
12721290 auto ScalarHeader = std::make_unique<BasicBlock *>(BasicBlock::Create (C, " " ));
12731291 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
1292+ VPBlockUtils::connectBlocks (VPBB1, ScalarHeaderVPBB);
12741293 VPlan Plan (VPBB0, VPBB1, ScalarHeaderVPBB);
12751294
12761295 IntegerType *Int32 = IntegerType::get (C, 32 );
@@ -1341,6 +1360,7 @@ TEST(VPRecipeTest, dumpRecipeUnnamedVPValuesInPlan) {
13411360 LLVMContext C;
13421361 auto ScalarHeader = std::make_unique<BasicBlock *>(BasicBlock::Create (C, " " ));
13431362 VPIRBasicBlock *ScalarHeaderVPBB = new VPIRBasicBlock (*ScalarHeader);
1363+ VPBlockUtils::connectBlocks (VPBB1, ScalarHeaderVPBB);
13441364 VPlan Plan (VPBB0, VPBB1, ScalarHeaderVPBB);
13451365
13461366 IntegerType *Int32 = IntegerType::get (C, 32 );
0 commit comments