File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed
test/Transforms/LoopVectorize Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -1182,16 +1182,6 @@ const VPRegionBlock *VPlan::getVectorLoopRegion() const {
11821182 return nullptr ;
11831183}
11841184
1185- VPBasicBlock *VPlan::getScalarPreheader () const {
1186- auto *MiddleVPBB =
1187- cast<VPBasicBlock>(getVectorLoopRegion ()->getSingleSuccessor ());
1188- auto *LastSucc = MiddleVPBB->getSuccessors ().back ();
1189- // If scalar preheader is connected to VPlan, it is the last successor of
1190- // MiddleVPBB. If this last successor is a VPIRBasicBlock, it is the Exit
1191- // block rather than the scalar preheader.
1192- return isa<VPIRBasicBlock>(LastSucc) ? nullptr : cast<VPBasicBlock>(LastSucc);
1193- }
1194-
11951185LLVM_DUMP_METHOD
11961186void VPlan::printDOT (raw_ostream &O) const {
11971187 VPlanPrinter Printer (O, *this );
Original file line number Diff line number Diff line change @@ -3898,7 +3898,9 @@ class VPlan {
38983898 }
38993899
39003900 // / Return the VPBasicBlock for the preheader of the scalar loop.
3901- VPBasicBlock *getScalarPreheader () const ;
3901+ VPBasicBlock *getScalarPreheader () const {
3902+ return cast<VPBasicBlock>(getScalarHeader ()->getSinglePredecessor ());
3903+ }
39023904
39033905 // / Return the VPIRBasicBlock wrapping the header of the scalar loop.
39043906 VPIRBasicBlock *getScalarHeader () const { return ScalarHeader; }
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ define i64 @multi_exiting_to_different_exits_live_in_exit_values() {
1515; CHECK-NEXT: ir-bb<entry>:
1616; CHECK-NEXT: IR %src = alloca [128 x i32], align 4
1717; CHECK-NEXT: IR call void @init(ptr %src)
18- ; CHECK-NEXT: No successors
18+ ; CHECK-NEXT: Successor(s): vector.ph
1919; CHECK-EMPTY:
2020; CHECK-NEXT: vector.ph:
2121; CHECK-NEXT: Successor(s): vector loop
@@ -99,7 +99,7 @@ define i64 @multi_exiting_to_same_exit_live_in_exit_values() {
9999; CHECK-NEXT: ir-bb<entry>:
100100; CHECK-NEXT: IR %src = alloca [128 x i32], align 4
101101; CHECK-NEXT: IR call void @init(ptr %src)
102- ; CHECK-NEXT: No successors
102+ ; CHECK-NEXT: Successor(s): vector.ph
103103; CHECK-EMPTY:
104104; CHECK-NEXT: vector.ph:
105105; CHECK-NEXT: Successor(s): vector loop
@@ -176,7 +176,7 @@ define i64 @multi_exiting_to_same_exit_live_in_exit_values_2() {
176176; CHECK-NEXT: ir-bb<entry>:
177177; CHECK-NEXT: IR %src = alloca [128 x i32], align 4
178178; CHECK-NEXT: IR call void @init(ptr %src)
179- ; CHECK-NEXT: No successors
179+ ; CHECK-NEXT: Successor(s): vector.ph
180180; CHECK-EMPTY:
181181; CHECK-NEXT: vector.ph:
182182; CHECK-NEXT: Successor(s): vector loop
You can’t perform that action at this time.
0 commit comments