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

Conversation

david-arm
Copy link
Contributor

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!

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!
@llvmbot
Copy link
Member

llvmbot commented Dec 20, 2024

@llvm/pr-subscribers-llvm-transforms

Author: David Sherwood (david-arm)

Changes

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!


Patch is 317.52 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/120738.diff

65 Files Affected:

  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll (+25-25)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll (+29-29)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll (+29-29)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i8-with-i8-index.ll (+29-29)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-f32-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-f32-stride-3.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-f32-stride-4.ll (+19-19)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i16-stride-2.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i16-stride-3.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i16-stride-4.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i16-stride-6.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-2-indices-0u.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-3-indices-01u.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-3-indices-0uu.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-3.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-4-indices-012u.ll (+19-19)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-4-indices-0uuu.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-4.ll (+19-19)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i32-stride-6.ll (+16-16)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i8-stride-2.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i8-stride-3.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-load-i8-stride-4.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-3.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-4.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-5.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-6.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f32-stride-7.ll (+16-16)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-3.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-4.ll (+16-16)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-5.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-6.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-f64-stride-7.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-2.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-3.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-4.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-5.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-6.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i16-stride-7.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-3.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-4.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-5.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-6.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i32-stride-7.ll (+16-16)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-2.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-3.ll (+17-17)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-4.ll (+16-16)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-5.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-6.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i64-stride-7.ll (+13-13)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-2.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-3.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-4.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-5.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-6.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/interleaved-store-i8-stride-7.ll (+26-26)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-gather-i32-with-i8-index.ll (+25-25)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-gather-i64-with-i8-index.ll (+25-25)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-load-i16.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-load-i32.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-load-i64.ll (+20-20)
  • (modified) llvm/test/Transforms/LoopVectorize/X86/CostModel/masked-load-i8.ll (+20-20)
diff --git a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll
index bb73b36e902d94..1c427a0107df14 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i16-with-i8-index.ll
@@ -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
diff --git a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll
index b94197a5764bd8..8cde13761bc543 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i32-with-i8-index.ll
@@ -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
diff --git a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll
index 3472231ddce6b9..3435df1b494c61 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i64-with-i8-index.ll
@@ -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
diff --git a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i8-with-i8-index.ll b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i8-with-i8-index.ll
index 998b4e4e92d033..7aeeff65184167 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i8-with-i8-index.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/CostModel/gather-i8-with-i8-index.ll
@@ -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 i8, ptr %inB, align 1
-; SSE2:  LV: Found an estimated cost of 25 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE2:  LV: Found an estimated cost of 51 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE2:  LV: Found an estimated cost of 103 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE2:  LV: Found an estimated cost of 207 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
+; SSE2:  Cost of 25 for VF 2: {{.*}}ir<%valB> = load
+; SSE2:  Cost of 51 for VF 4: {{.*}}ir<%valB> = load
+; SSE2:  Cost of 103 for VF 8: {{.*}}ir<%valB> = load
+; SSE2:  Cost of 207 for VF 16: {{.*}}ir<%valB> = load
 ;
 ; SSE42-LABEL: 'test'
 ; SSE42:  LV: Found an estimated cost of 1 for VF 1 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE42:  LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE42:  LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE42:  LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
-; SSE42:  LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, ptr %inB, align 1
+; 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 i8, ptr %inB, align 1
-; AVX1:  LV: Found an estimated cost of 24 for VF 2 For instruction: %valB = load i8, ptr %inB, align 1
-; AVX1:  LV: Found an estimated cost of 48 for VF 4 For instruction: %valB = load i8, ptr %inB, align 1
-; AVX1:  LV: Found an estimated cost of 96 for VF 8 For instruction: %valB = load i8, ptr %inB, align 1
-; AVX1:  LV: Found an estimated cost of 192 for VF 16 For instruction: %valB = load i8, ptr %inB, ...
[truncated]

@david-arm
Copy link
Contributor Author

This PR follows on from #113697, trying to get as many tests ready as possible for when we can remove the assert in the loop vectoriser that the legacy cost model matches the vplan cost model.

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - but I'm surprised you weren't able to get the update_analyze_test_checks script to do this for you?

@david-arm
Copy link
Contributor Author

LGTM - but I'm surprised you weren't able to get the update_analyze_test_checks script to do this for you?

Hmm, maybe you're right? I hadn't thought of that. I just assumed the analyze script would end up generating way too many CHECK lines, but perhaps there is a way to use a filter.

@david-arm david-arm merged commit 5845298 into llvm:main Dec 20, 2024
10 checks passed
@fhahn
Copy link
Contributor

fhahn commented Dec 20, 2024

Thanks for cleaning this up. Might be good to document the recommended command to semi-automatically update the tests.

@david-arm
Copy link
Contributor Author

Thanks for cleaning this up. Might be good to document the recommended command to semi-automatically update the tests.

Heh, the script I used to do this is probably quite embarrassing! But yeah I agree with you - if I can come up with a nice way of documenting I'll put it somewhere.

@david-arm david-arm deleted the tidy_costs_nfc branch January 28, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants