Skip to content

Commit 3b890b6

Browse files
committed
Address review comment
* Update diff_exit_block_needs_scev_check test after rebase. * Update debug/report message when vectoriser bails out for uncountable early exit loops.
1 parent 7dad4ad commit 3b890b6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9793,10 +9793,11 @@ bool LoopVectorizePass::processLoop(Loop *L) {
97939793
}
97949794

97959795
if (LVL.hasUncountableEarlyExit()) {
9796-
reportVectorizationFailure(
9797-
"Auto-vectorization of early exit loops is not yet supported.",
9798-
"Auto-vectorization of early exit loops is not yet supported.",
9799-
"EarlyExitLoopsUnsupported", ORE, L);
9796+
reportVectorizationFailure("Auto-vectorization of loops with uncountable "
9797+
"early exit is not yet supported",
9798+
"Auto-vectorization of loops with uncountable "
9799+
"early exit is not yet supported",
9800+
"UncountableEarlyExitLoopsUnsupported", ORE, L);
98009801
return false;
98019802
}
98029803

llvm/test/Transforms/LoopVectorize/simple_early_exit.ll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ define i64 @same_exit_block_pre_inc_use1() {
99
; DEBUG-LABEL: LV: Checking a loop in 'same_exit_block_pre_inc_use1'
1010
; DEBUG: LV: Found an early exit loop with symbolic max backedge taken count: 63
1111
; DEBUG-NEXT: LV: We can vectorize this loop!
12-
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of early exit loops is not yet supported.
12+
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of loops with uncountable early exit is not yet supported.
1313
; CHECK-LABEL: define i64 @same_exit_block_pre_inc_use1() {
1414
; CHECK-NEXT: entry:
1515
; CHECK-NEXT: [[P1:%.*]] = alloca [1024 x i8], align 1
@@ -1346,7 +1346,7 @@ define i64 @loop_contains_load_after_early_exit(ptr dereferenceable(1024) align(
13461346
; DEBUG-LABEL: LV: Checking a loop in 'loop_contains_load_after_early_exit'
13471347
; DEBUG: LV: Found an early exit loop with symbolic max backedge taken count: 63
13481348
; DEBUG-NEXT: LV: We can vectorize this loop!
1349-
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of early exit loops is not yet supported.
1349+
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of loops with uncountable early exit is not yet supported.
13501350
; CHECK-LABEL: define i64 @loop_contains_load_after_early_exit(
13511351
; CHECK-SAME: ptr align 8 dereferenceable(1024) [[P2:%.*]]) {
13521352
; CHECK-NEXT: entry:
@@ -1619,10 +1619,9 @@ loop.end:
16191619
; The form of the induction variables requires SCEV predicates.
16201620
define i32 @diff_exit_block_needs_scev_check(i32 %end) {
16211621
; DEBUG-LABEL: LV: Checking a loop in 'diff_exit_block_needs_scev_check'
1622-
; DEBUG: LV: Found an early exit. Retrying with speculative exit count.
1623-
; DEBUG-NEXT: LV: Found speculative backedge taken count: (-1 + (1 umax (zext i10 (trunc i32 %end to i10) to i32)))<nsw>
1622+
; DEBUG: Found an early exit loop with symbolic max backedge taken count: (-1 + (1 umax (zext i10 (trunc i32 %end to i10) to i32)))<nsw>
16241623
; DEBUG-NEXT: LV: We can vectorize this loop!
1625-
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of early exit loops is not yet supported.
1624+
; DEBUG-NEXT: LV: Not vectorizing: Auto-vectorization of loops with uncountable early exit is not yet supported.
16261625
; CHECK-LABEL: define i32 @diff_exit_block_needs_scev_check(
16271626
; CHECK-SAME: i32 [[END:%.*]]) {
16281627
; CHECK-NEXT: entry:
@@ -1692,7 +1691,7 @@ declare void @abort()
16921691
define i32 @diff_blocks_invariant_early_exit_cond(ptr %s) {
16931692
; DEBUG-LABEL: LV: Checking a loop in 'diff_blocks_invariant_early_exit_cond'
16941693
; DEBUG: LV: Found an early exit loop with symbolic max backedge taken count: 275
1695-
; DEBUG: LV: Not vectorizing: Auto-vectorization of early exit loops is not yet supported.
1694+
; DEBUG: LV: Not vectorizing: Auto-vectorization of loops with uncountable early exit is not yet supported.
16961695
; CHECK-LABEL: define i32 @diff_blocks_invariant_early_exit_cond(
16971696
; CHECK-SAME: ptr [[S:%.*]]) {
16981697
; CHECK-NEXT: entry:

0 commit comments

Comments
 (0)