Skip to content

Commit 5845298

Browse files
authored
[LoopVectorize] Teach some X86 cost model tests to use new vplan costs (#120738)
I've only fixed up the tests where I was able to use a simple sed script to replace the text. Even after this patch lands, there are still over 50 tests that need updating in X86/CostModel!
1 parent 70eac25 commit 5845298

File tree

65 files changed

+1373
-1373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1373
-1373
lines changed

llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,43 @@ target triple = "x86_64-unknown-linux-gnu"
1818
define void @test() {
1919
; SSE-LABEL: 'test'
2020
; SSE: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
21-
; SSE: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
22-
; SSE: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
23-
; SSE: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
24-
; SSE: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
21+
; SSE: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
22+
; SSE: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
23+
; SSE: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
24+
; SSE: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
2525
;
2626
; AVX1-LABEL: 'test'
2727
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
28-
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
29-
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
30-
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
31-
; AVX1: LV: Found an estimated cost of 193 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
32-
; AVX1: LV: Found an estimated cost of 386 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
28+
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
29+
; AVX1: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
30+
; AVX1: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
31+
; AVX1: Cost of 193 for VF 16: {{.*}}ir<%valB> = load
32+
; AVX1: Cost of 386 for VF 32: {{.*}}ir<%valB> = load
3333
;
3434
; AVX2-SLOWGATHER-LABEL: 'test'
3535
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
36-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
37-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
38-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
39-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 33 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
40-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 66 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
36+
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
37+
; AVX2-SLOWGATHER: Cost of 8 for VF 4: {{.*}}ir<%valB> = load
38+
; AVX2-SLOWGATHER: Cost of 16 for VF 8: {{.*}}ir<%valB> = load
39+
; AVX2-SLOWGATHER: Cost of 33 for VF 16: {{.*}}ir<%valB> = load
40+
; AVX2-SLOWGATHER: Cost of 66 for VF 32: {{.*}}ir<%valB> = load
4141
;
4242
; AVX2-FASTGATHER-LABEL: 'test'
4343
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
44-
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
45-
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
46-
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
47-
; AVX2-FASTGATHER: LV: Found an estimated cost of 53 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
48-
; AVX2-FASTGATHER: LV: Found an estimated cost of 106 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
44+
; AVX2-FASTGATHER: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
45+
; AVX2-FASTGATHER: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
46+
; AVX2-FASTGATHER: Cost of 26 for VF 8: {{.*}}ir<%valB> = load
47+
; AVX2-FASTGATHER: Cost of 53 for VF 16: {{.*}}ir<%valB> = load
48+
; AVX2-FASTGATHER: Cost of 106 for VF 32: {{.*}}ir<%valB> = load
4949
;
5050
; AVX512-LABEL: 'test'
5151
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
52-
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
53-
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
54-
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
55-
; AVX512: LV: Found an estimated cost of 55 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
56-
; AVX512: LV: Found an estimated cost of 111 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
57-
; AVX512: LV: Found an estimated cost of 222 for VF 64 For instruction: %valB = load i16, ptr %inB, align 2
52+
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
53+
; AVX512: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
54+
; AVX512: Cost of 27 for VF 8: {{.*}}ir<%valB> = load
55+
; AVX512: Cost of 55 for VF 16: {{.*}}ir<%valB> = load
56+
; AVX512: Cost of 111 for VF 32: {{.*}}ir<%valB> = load
57+
; AVX512: Cost of 222 for VF 64: {{.*}}ir<%valB> = load
5858
;
5959
entry:
6060
br label %for.body

llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@ target triple = "x86_64-unknown-linux-gnu"
1818
define void @test() {
1919
; SSE2-LABEL: 'test'
2020
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
21-
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
22-
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
23-
; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
24-
; SSE2: LV: Found an estimated cost of 204 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
21+
; SSE2: Cost of 25 for VF 2: {{.*}}ir<%valB> = load
22+
; SSE2: Cost of 51 for VF 4: {{.*}}ir<%valB> = load
23+
; SSE2: Cost of 102 for VF 8: {{.*}}ir<%valB> = load
24+
; SSE2: Cost of 204 for VF 16: {{.*}}ir<%valB> = load
2525
;
2626
; SSE42-LABEL: 'test'
2727
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
28-
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
29-
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
30-
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
31-
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
28+
; SSE42: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
29+
; SSE42: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
30+
; SSE42: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
31+
; SSE42: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
3232
;
3333
; AVX1-LABEL: 'test'
3434
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
35-
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
36-
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
37-
; AVX1: LV: Found an estimated cost of 97 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
38-
; AVX1: LV: Found an estimated cost of 194 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
39-
; AVX1: LV: Found an estimated cost of 388 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
35+
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
36+
; AVX1: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
37+
; AVX1: Cost of 97 for VF 8: {{.*}}ir<%valB> = load
38+
; AVX1: Cost of 194 for VF 16: {{.*}}ir<%valB> = load
39+
; AVX1: Cost of 388 for VF 32: {{.*}}ir<%valB> = load
4040
;
4141
; AVX2-SLOWGATHER-LABEL: 'test'
4242
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
43-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
44-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
45-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 17 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
46-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 34 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
47-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 68 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
43+
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
44+
; AVX2-SLOWGATHER: Cost of 8 for VF 4: {{.*}}ir<%valB> = load
45+
; AVX2-SLOWGATHER: Cost of 17 for VF 8: {{.*}}ir<%valB> = load
46+
; AVX2-SLOWGATHER: Cost of 34 for VF 16: {{.*}}ir<%valB> = load
47+
; AVX2-SLOWGATHER: Cost of 68 for VF 32: {{.*}}ir<%valB> = load
4848
;
4949
; AVX2-FASTGATHER-LABEL: 'test'
5050
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
51-
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
52-
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
53-
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
54-
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
55-
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
51+
; AVX2-FASTGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
52+
; AVX2-FASTGATHER: Cost of 6 for VF 4: {{.*}}ir<%valB> = load
53+
; AVX2-FASTGATHER: Cost of 12 for VF 8: {{.*}}ir<%valB> = load
54+
; AVX2-FASTGATHER: Cost of 24 for VF 16: {{.*}}ir<%valB> = load
55+
; AVX2-FASTGATHER: Cost of 48 for VF 32: {{.*}}ir<%valB> = load
5656
;
5757
; AVX512-LABEL: 'test'
5858
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
59-
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
60-
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
61-
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
62-
; AVX512: LV: Found an estimated cost of 18 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
63-
; AVX512: LV: Found an estimated cost of 36 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
64-
; AVX512: LV: Found an estimated cost of 72 for VF 64 For instruction: %valB = load i32, ptr %inB, align 4
59+
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
60+
; AVX512: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
61+
; AVX512: Cost of 10 for VF 8: {{.*}}ir<%valB> = load
62+
; AVX512: Cost of 18 for VF 16: {{.*}}ir<%valB> = load
63+
; AVX512: Cost of 36 for VF 32: {{.*}}ir<%valB> = load
64+
; AVX512: Cost of 72 for VF 64: {{.*}}ir<%valB> = load
6565
;
6666
entry:
6767
br label %for.body

llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@ target triple = "x86_64-unknown-linux-gnu"
1818
define void @test() {
1919
; SSE2-LABEL: 'test'
2020
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
21-
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
22-
; SSE2: LV: Found an estimated cost of 50 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
23-
; SSE2: LV: Found an estimated cost of 100 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
24-
; SSE2: LV: Found an estimated cost of 200 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
21+
; SSE2: Cost of 25 for VF 2: {{.*}}ir<%valB> = load
22+
; SSE2: Cost of 50 for VF 4: {{.*}}ir<%valB> = load
23+
; SSE2: Cost of 100 for VF 8: {{.*}}ir<%valB> = load
24+
; SSE2: Cost of 200 for VF 16: {{.*}}ir<%valB> = load
2525
;
2626
; SSE42-LABEL: 'test'
2727
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
28-
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
29-
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
30-
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
31-
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
28+
; SSE42: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
29+
; SSE42: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
30+
; SSE42: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
31+
; SSE42: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
3232
;
3333
; AVX1-LABEL: 'test'
3434
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
35-
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
36-
; AVX1: LV: Found an estimated cost of 49 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
37-
; AVX1: LV: Found an estimated cost of 98 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
38-
; AVX1: LV: Found an estimated cost of 196 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
39-
; AVX1: LV: Found an estimated cost of 392 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
35+
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
36+
; AVX1: Cost of 49 for VF 4: {{.*}}ir<%valB> = load
37+
; AVX1: Cost of 98 for VF 8: {{.*}}ir<%valB> = load
38+
; AVX1: Cost of 196 for VF 16: {{.*}}ir<%valB> = load
39+
; AVX1: Cost of 392 for VF 32: {{.*}}ir<%valB> = load
4040
;
4141
; AVX2-SLOWGATHER-LABEL: 'test'
4242
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
43-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
44-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 9 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
45-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 18 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
46-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 36 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
47-
; AVX2-SLOWGATHER: LV: Found an estimated cost of 72 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
43+
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
44+
; AVX2-SLOWGATHER: Cost of 9 for VF 4: {{.*}}ir<%valB> = load
45+
; AVX2-SLOWGATHER: Cost of 18 for VF 8: {{.*}}ir<%valB> = load
46+
; AVX2-SLOWGATHER: Cost of 36 for VF 16: {{.*}}ir<%valB> = load
47+
; AVX2-SLOWGATHER: Cost of 72 for VF 32: {{.*}}ir<%valB> = load
4848
;
4949
; AVX2-FASTGATHER-LABEL: 'test'
5050
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
51-
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
52-
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
53-
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
54-
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
55-
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
51+
; AVX2-FASTGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
52+
; AVX2-FASTGATHER: Cost of 6 for VF 4: {{.*}}ir<%valB> = load
53+
; AVX2-FASTGATHER: Cost of 12 for VF 8: {{.*}}ir<%valB> = load
54+
; AVX2-FASTGATHER: Cost of 24 for VF 16: {{.*}}ir<%valB> = load
55+
; AVX2-FASTGATHER: Cost of 48 for VF 32: {{.*}}ir<%valB> = load
5656
;
5757
; AVX512-LABEL: 'test'
5858
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
59-
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
60-
; AVX512: LV: Found an estimated cost of 14 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
61-
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
62-
; AVX512: LV: Found an estimated cost of 20 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
63-
; AVX512: LV: Found an estimated cost of 40 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
64-
; AVX512: LV: Found an estimated cost of 80 for VF 64 For instruction: %valB = load i64, ptr %inB, align 8
59+
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
60+
; AVX512: Cost of 14 for VF 4: {{.*}}ir<%valB> = load
61+
; AVX512: Cost of 10 for VF 8: {{.*}}ir<%valB> = load
62+
; AVX512: Cost of 20 for VF 16: {{.*}}ir<%valB> = load
63+
; AVX512: Cost of 40 for VF 32: {{.*}}ir<%valB> = load
64+
; AVX512: Cost of 80 for VF 64: {{.*}}ir<%valB> = load
6565
;
6666
entry:
6767
br label %for.body

0 commit comments

Comments
 (0)