Skip to content

Commit 1442fe0

Browse files
committed
[LV] Update test to use dereferenceable attribute instead of assumption.
Use dereferenceable attribute instead of assumption to make the tests independent of #128061.
1 parent 00c5eda commit 1442fe0

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

llvm/test/Transforms/LoopVectorize/vector-loop-backedge-elimination-early-exit.ll

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
77

88
; Check if the vector loop condition can be simplified to true for a given
99
; VF/IC combination.
10-
define i8 @test_early_exit_max_tc_less_than_16(ptr %A, i64 %N) nosync nofree {
10+
define i8 @test_early_exit_max_tc_less_than_16(ptr dereferenceable(16) %A) nosync nofree {
1111
; VF8UF1-LABEL: define i8 @test_early_exit_max_tc_less_than_16(
12-
; VF8UF1-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
12+
; VF8UF1-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0:[0-9]+]] {
1313
; VF8UF1-NEXT: [[ENTRY:.*]]:
14-
; VF8UF1-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
1514
; VF8UF1-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
1615
; VF8UF1: [[VECTOR_PH]]:
1716
; VF8UF1-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -51,9 +50,8 @@ define i8 @test_early_exit_max_tc_less_than_16(ptr %A, i64 %N) nosync nofree {
5150
; VF8UF1-NEXT: ret i8 [[RES]]
5251
;
5352
; VF8UF2-LABEL: define i8 @test_early_exit_max_tc_less_than_16(
54-
; VF8UF2-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
53+
; VF8UF2-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0:[0-9]+]] {
5554
; VF8UF2-NEXT: [[ENTRY:.*]]:
56-
; VF8UF2-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
5755
; VF8UF2-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
5856
; VF8UF2: [[VECTOR_PH]]:
5957
; VF8UF2-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -93,9 +91,8 @@ define i8 @test_early_exit_max_tc_less_than_16(ptr %A, i64 %N) nosync nofree {
9391
; VF8UF2-NEXT: ret i8 [[RES]]
9492
;
9593
; VF16UF1-LABEL: define i8 @test_early_exit_max_tc_less_than_16(
96-
; VF16UF1-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
94+
; VF16UF1-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0:[0-9]+]] {
9795
; VF16UF1-NEXT: [[ENTRY:.*]]:
98-
; VF16UF1-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
9996
; VF16UF1-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
10097
; VF16UF1: [[VECTOR_PH]]:
10198
; VF16UF1-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -135,7 +132,6 @@ define i8 @test_early_exit_max_tc_less_than_16(ptr %A, i64 %N) nosync nofree {
135132
; VF16UF1-NEXT: ret i8 [[RES]]
136133
;
137134
entry:
138-
call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 32) ]
139135
br label %loop.header
140136

141137
loop.header:
@@ -155,11 +151,10 @@ exit:
155151
ret i8 %res
156152
}
157153

158-
define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(ptr %A, i64 %N) nosync nofree {
154+
define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(ptr dereferenceable(16) %A) nosync nofree {
159155
; VF8UF1-LABEL: define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(
160-
; VF8UF1-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
156+
; VF8UF1-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0]] {
161157
; VF8UF1-NEXT: [[ENTRY:.*]]:
162-
; VF8UF1-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
163158
; VF8UF1-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
164159
; VF8UF1: [[VECTOR_PH]]:
165160
; VF8UF1-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -203,9 +198,8 @@ define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(ptr %A, i64
203198
; VF8UF1-NEXT: ret i64 [[RES]]
204199
;
205200
; VF8UF2-LABEL: define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(
206-
; VF8UF2-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
201+
; VF8UF2-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0]] {
207202
; VF8UF2-NEXT: [[ENTRY:.*]]:
208-
; VF8UF2-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
209203
; VF8UF2-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
210204
; VF8UF2: [[VECTOR_PH]]:
211205
; VF8UF2-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -250,9 +244,8 @@ define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(ptr %A, i64
250244
; VF8UF2-NEXT: ret i64 [[RES]]
251245
;
252246
; VF16UF1-LABEL: define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(
253-
; VF16UF1-SAME: ptr [[A:%.*]], i64 [[N:%.*]]) #[[ATTR0]] {
247+
; VF16UF1-SAME: ptr dereferenceable(16) [[A:%.*]]) #[[ATTR0]] {
254248
; VF16UF1-NEXT: [[ENTRY:.*]]:
255-
; VF16UF1-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr [[A]], i64 32) ]
256249
; VF16UF1-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
257250
; VF16UF1: [[VECTOR_PH]]:
258251
; VF16UF1-NEXT: br label %[[VECTOR_BODY:.*]]
@@ -296,7 +289,6 @@ define i64 @test_early_exit_max_tc_less_than_16_with_iv_used_outside(ptr %A, i64
296289
; VF16UF1-NEXT: ret i64 [[RES]]
297290
;
298291
entry:
299-
call void @llvm.assume(i1 true) [ "dereferenceable"(ptr %A, i64 32) ]
300292
br label %loop.header
301293

302294
loop.header:

0 commit comments

Comments
 (0)