[llvm] 89e530a - [CostModel[X86] Update shuffle non-pow-2 tests to not analyse shuffle(undef,undef)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 16 10:37:23 PST 2024
Author: Simon Pilgrim
Date: 2024-12-16T18:32:13Z
New Revision: 89e530a27c04f1c45a8c9b5cb97099b4b9d2b048
URL: https://github.com/llvm/llvm-project/commit/89e530a27c04f1c45a8c9b5cb97099b4b9d2b048
DIFF: https://github.com/llvm/llvm-project/commit/89e530a27c04f1c45a8c9b5cb97099b4b9d2b048.diff
LOG: [CostModel[X86] Update shuffle non-pow-2 tests to not analyse shuffle(undef,undef)
Avoid shuffle patterns that can be folded away.
Added:
Modified:
llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-codesize.ll
llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-latency.ll
llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-sizelatency.ll
llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-codesize.ll b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-codesize.ll
index 2ccb97a9ed7a60..f32f94e7e5cc41 100644
--- a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-codesize.ll
+++ b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-codesize.ll
@@ -2,17 +2,17 @@
; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=code-size -mattr=+sse2 | FileCheck %s -check-prefixes=SSE
; RUN: opt < %s -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s -check-prefixes=AVX
-define void @test() {
+define void @test(<9 x double> noundef %src) {
; SSE-LABEL: 'test'
-; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; AVX-LABEL: 'test'
-; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
entry:
- %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+ %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
ret void
}
diff --git a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-latency.ll b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-latency.ll
index 4eeb4e834d339b..e580b90c8acfb9 100644
--- a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-latency.ll
+++ b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-latency.ll
@@ -2,17 +2,17 @@
; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=latency -mattr=+sse2 | FileCheck %s -check-prefixes=SSE
; RUN: opt < %s -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s -check-prefixes=AVX
-define void @test() {
+define void @test(<9 x double> noundef %src) {
; SSE-LABEL: 'test'
-; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; AVX-LABEL: 'test'
-; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
entry:
- %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+ %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
ret void
}
diff --git a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-sizelatency.ll b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-sizelatency.ll
index 13e846950721a0..371345706bfddc 100644
--- a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-sizelatency.ll
+++ b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2-sizelatency.ll
@@ -2,17 +2,17 @@
; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=size-latency -mattr=+sse2 | FileCheck %s -check-prefixes=SSE
; RUN: opt < %s -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s -check-prefixes=AVX
-define void @test() {
+define void @test(<9 x double> noundef %src) {
; SSE-LABEL: 'test'
-; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; SSE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void
;
; AVX-LABEL: 'test'
-; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
entry:
- %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+ %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
ret void
}
diff --git a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2.ll b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2.ll
index f27241dfd8cf9e..4c9edbbf2b0f2b 100644
--- a/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2.ll
+++ b/llvm/test/Analysis/CostModel/X86/shuffle-non-pow-2.ll
@@ -2,17 +2,17 @@
; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -mattr=+sse2 | FileCheck %s -check-prefixes=SSE
; RUN: opt < %s -mtriple=x86_64-unknown-linux -mcpu=corei7-avx -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s -check-prefixes=AVX
-define void @test() {
+define void @test(<9 x double> noundef %src) {
; SSE-LABEL: 'test'
-; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; SSE-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; SSE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; AVX-LABEL: 'test'
-; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+; AVX-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
; AVX-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
entry:
- %matins.2.2 = shufflevector <9 x double> undef, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
+ %matins.2.2 = shufflevector <9 x double> %src, <9 x double> undef, <9 x i32> <i32 0, i32 3, i32 6, i32 1, i32 4, i32 7, i32 2, i32 5, i32 8>
ret void
}
More information about the llvm-commits
mailing list