Skip to content

Commit a0af583

Browse files
committed
!fixup update after merging llvm#112138
1 parent f53cf1b commit a0af583

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff 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-
11951185
LLVM_DUMP_METHOD
11961186
void VPlan::printDOT(raw_ostream &O) const {
11971187
VPlanPrinter Printer(O, *this);

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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; }

llvm/test/Transforms/LoopVectorize/uncountable-early-exit-vplan.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)