Skip to content

[LoopVectorize] Teach some X86 cost model tests to use new vplan costs #120738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ target triple = "x86_64-unknown-linux-gnu"
define void @test() {
; SSE-LABEL: 'test'
; SSE: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; SSE: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; SSE: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
; SSE: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
; SSE: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 193 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: LV: Found an estimated cost of 386 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; AVX1: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
; AVX1: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
; AVX1: Cost of 193 for VF 16: {{.*}}ir<%valB> = load
; AVX1: Cost of 386 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 16 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 33 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: LV: Found an estimated cost of 66 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 8 for VF 4: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 16 for VF 8: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 33 for VF 16: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 66 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 26 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 53 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: LV: Found an estimated cost of 106 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
; AVX2-FASTGATHER: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 26 for VF 8: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 53 for VF 16: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 106 for VF 32: {{.*}}ir<%valB> = load
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 27 for VF 8 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 55 for VF 16 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 111 for VF 32 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: LV: Found an estimated cost of 222 for VF 64 For instruction: %valB = load i16, ptr %inB, align 2
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
; AVX512: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
; AVX512: Cost of 27 for VF 8: {{.*}}ir<%valB> = load
; AVX512: Cost of 55 for VF 16: {{.*}}ir<%valB> = load
; AVX512: Cost of 111 for VF 32: {{.*}}ir<%valB> = load
; AVX512: Cost of 222 for VF 64: {{.*}}ir<%valB> = load
;
entry:
br label %for.body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,50 @@ target triple = "x86_64-unknown-linux-gnu"
define void @test() {
; SSE2-LABEL: 'test'
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 102 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: LV: Found an estimated cost of 204 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; SSE2: Cost of 25 for VF 2: {{.*}}ir<%valB> = load
; SSE2: Cost of 51 for VF 4: {{.*}}ir<%valB> = load
; SSE2: Cost of 102 for VF 8: {{.*}}ir<%valB> = load
; SSE2: Cost of 204 for VF 16: {{.*}}ir<%valB> = load
;
; SSE42-LABEL: 'test'
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; SSE42: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; SSE42: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
; SSE42: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
; SSE42: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 97 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 194 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: LV: Found an estimated cost of 388 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; AVX1: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
; AVX1: Cost of 97 for VF 8: {{.*}}ir<%valB> = load
; AVX1: Cost of 194 for VF 16: {{.*}}ir<%valB> = load
; AVX1: Cost of 388 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 8 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 17 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 34 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: LV: Found an estimated cost of 68 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 8 for VF 4: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 17 for VF 8: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 34 for VF 16: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 68 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
; AVX2-FASTGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 6 for VF 4: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 12 for VF 8: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 24 for VF 16: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 48 for VF 32: {{.*}}ir<%valB> = load
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 13 for VF 4 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 18 for VF 16 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 36 for VF 32 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: LV: Found an estimated cost of 72 for VF 64 For instruction: %valB = load i32, ptr %inB, align 4
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
; AVX512: Cost of 13 for VF 4: {{.*}}ir<%valB> = load
; AVX512: Cost of 10 for VF 8: {{.*}}ir<%valB> = load
; AVX512: Cost of 18 for VF 16: {{.*}}ir<%valB> = load
; AVX512: Cost of 36 for VF 32: {{.*}}ir<%valB> = load
; AVX512: Cost of 72 for VF 64: {{.*}}ir<%valB> = load
;
entry:
br label %for.body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,50 @@ target triple = "x86_64-unknown-linux-gnu"
define void @test() {
; SSE2-LABEL: 'test'
; SSE2: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 50 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 100 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: LV: Found an estimated cost of 200 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; SSE2: Cost of 25 for VF 2: {{.*}}ir<%valB> = load
; SSE2: Cost of 50 for VF 4: {{.*}}ir<%valB> = load
; SSE2: Cost of 100 for VF 8: {{.*}}ir<%valB> = load
; SSE2: Cost of 200 for VF 16: {{.*}}ir<%valB> = load
;
; SSE42-LABEL: 'test'
; SSE42: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; SSE42: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; SSE42: Cost of 48 for VF 4: {{.*}}ir<%valB> = load
; SSE42: Cost of 96 for VF 8: {{.*}}ir<%valB> = load
; SSE42: Cost of 192 for VF 16: {{.*}}ir<%valB> = load
;
; AVX1-LABEL: 'test'
; AVX1: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 49 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 98 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 196 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: LV: Found an estimated cost of 392 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
; AVX1: Cost of 24 for VF 2: {{.*}}ir<%valB> = load
; AVX1: Cost of 49 for VF 4: {{.*}}ir<%valB> = load
; AVX1: Cost of 98 for VF 8: {{.*}}ir<%valB> = load
; AVX1: Cost of 196 for VF 16: {{.*}}ir<%valB> = load
; AVX1: Cost of 392 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-SLOWGATHER-LABEL: 'test'
; AVX2-SLOWGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 9 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 18 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 36 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: LV: Found an estimated cost of 72 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-SLOWGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 9 for VF 4: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 18 for VF 8: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 36 for VF 16: {{.*}}ir<%valB> = load
; AVX2-SLOWGATHER: Cost of 72 for VF 32: {{.*}}ir<%valB> = load
;
; AVX2-FASTGATHER-LABEL: 'test'
; AVX2-FASTGATHER: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 4 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 6 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 12 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 24 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: LV: Found an estimated cost of 48 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
; AVX2-FASTGATHER: Cost of 4 for VF 2: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 6 for VF 4: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 12 for VF 8: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 24 for VF 16: {{.*}}ir<%valB> = load
; AVX2-FASTGATHER: Cost of 48 for VF 32: {{.*}}ir<%valB> = load
;
; AVX512-LABEL: 'test'
; AVX512: LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 6 for VF 2 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 14 for VF 4 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 10 for VF 8 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 20 for VF 16 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 40 for VF 32 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: LV: Found an estimated cost of 80 for VF 64 For instruction: %valB = load i64, ptr %inB, align 8
; AVX512: Cost of 6 for VF 2: {{.*}}ir<%valB> = load
; AVX512: Cost of 14 for VF 4: {{.*}}ir<%valB> = load
; AVX512: Cost of 10 for VF 8: {{.*}}ir<%valB> = load
; AVX512: Cost of 20 for VF 16: {{.*}}ir<%valB> = load
; AVX512: Cost of 40 for VF 32: {{.*}}ir<%valB> = load
; AVX512: Cost of 80 for VF 64: {{.*}}ir<%valB> = load
;
entry:
br label %for.body
Expand Down
Loading
Loading