diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-12-15 12:12:45 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-12-15 12:12:45 +0000 |
commit | 9876ed07f633af7702d4f06de8666a0a48c20fb6 (patch) | |
tree | d06576fc7ba7d99f65c7ca6996dc00e15d5eb269 /llvm/test | |
parent | ec02b8d4c03e4c5cb9274fe35a1de1b80067ff2e (diff) | |
download | bcm5719-llvm-9876ed07f633af7702d4f06de8666a0a48c20fb6.tar.gz bcm5719-llvm-9876ed07f633af7702d4f06de8666a0a48c20fb6.zip |
[CostModel] Fix long standing bug with reverse shuffle mask detection
Incorrect 'undef' mask index matching meant that broadcast shuffles could be detected as reverse shuffles
llvm-svn: 289811
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Analysis/CostModel/X86/shuffle-broadcast.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Analysis/CostModel/X86/shuffle-broadcast.ll b/llvm/test/Analysis/CostModel/X86/shuffle-broadcast.ll new file mode 100644 index 00000000000..579c19eeab1 --- /dev/null +++ b/llvm/test/Analysis/CostModel/X86/shuffle-broadcast.ll @@ -0,0 +1,31 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE2 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+ssse3 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSSE3 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+sse4.2 | FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=SSE42 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX1 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx2 | FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX2 +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512F +; RUN: opt < %s -cost-model -analyze -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW + +; +; Verify the cost model for broadcast shuffles. +; + +; CHECK-LABEL: 'test_vXf64' +define void @test_vXf64(<2 x double> %src128, <4 x double> %src256, <8 x double> %src512) { + ; SSE: Unknown cost {{.*}} %V128 = shufflevector + ; AVX: Unknown cost {{.*}} %V128 = shufflevector + ; AVX512: Unknown cost {{.*}} %V128 = shufflevector + %V128 = shufflevector <2 x double> %src128, <2 x double> undef, <2 x i32> zeroinitializer + + ; SSE: Unknown cost {{.*}} %V256 = shufflevector + ; AVX: Unknown cost {{.*}} %V256 = shufflevector + ; AVX512: Unknown cost {{.*}} %V256 = shufflevector + %V256 = shufflevector <4 x double> %src256, <4 x double> undef, <4 x i32> zeroinitializer + + ; SSE: Unknown cost {{.*}} %V512 = shufflevector + ; AVX: Unknown cost {{.*}} %V512 = shufflevector + ; AVX512: Unknown cost {{.*}} %V512 = shufflevector + %V512 = shufflevector <8 x double> %src512, <8 x double> undef, <8 x i32> zeroinitializer + + ret void +} |