summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/avx-vinsertf128.ll
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-15 21:45:54 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-08-15 21:45:54 +0000
commit50b37c79203668af8b223710dc6362d399040fdd (patch)
tree548cb79d6f480311df4ffd6e9e5bdef83442e7d0 /test/CodeGen/X86/avx-vinsertf128.ll
parent7a328270be871f640d94fcebfd48dee02950fb8c (diff)
downloadllvm-50b37c79203668af8b223710dc6362d399040fdd.tar.gz
llvm-50b37c79203668af8b223710dc6362d399040fdd.tar.bz2
llvm-50b37c79203668af8b223710dc6362d399040fdd.tar.xz
Fix PR10656. It's only profitable to use 128-bit inserts and extracts
when AVX mode is one. Otherwise is just more work for the type legalizer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/avx-vinsertf128.ll')
-rw-r--r--test/CodeGen/X86/avx-vinsertf128.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avx-vinsertf128.ll b/test/CodeGen/X86/avx-vinsertf128.ll
index b54b57b8d1..a6f258513a 100644
--- a/test/CodeGen/X86/avx-vinsertf128.ll
+++ b/test/CodeGen/X86/avx-vinsertf128.ll
@@ -1,4 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck -check-prefix=CHECK-SSE %s
; CHECK-NOT: vunpck
; CHECK: vinsertf128 $1
@@ -16,3 +17,22 @@ entry:
ret <4 x double> %shuffle
}
+declare <2 x double> @llvm.x86.sse2.min.pd(<2 x double>, <2 x double>) nounwind readnone
+
+declare <2 x double> @llvm.x86.sse2.min.sd(<2 x double>, <2 x double>) nounwind readnone
+
+; Just check that no crash happens
+; CHECK-SSE: _insert_crash
+define void @insert_crash() nounwind {
+allocas:
+ %v1.i.i451 = shufflevector <4 x double> zeroinitializer, <4 x double> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
+ %ret_0a.i.i.i452 = shufflevector <4 x double> %v1.i.i451, <4 x double> undef, <2 x i32> <i32 0, i32 1>
+ %vret_0.i.i.i454 = tail call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> %ret_0a.i.i.i452, <2 x double> undef) nounwind
+ %ret_val.i.i.i463 = tail call <2 x double> @llvm.x86.sse2.min.sd(<2 x double> %vret_0.i.i.i454, <2 x double> undef) nounwind
+ %ret.i1.i.i464 = extractelement <2 x double> %ret_val.i.i.i463, i32 0
+ %double2float = fptrunc double %ret.i1.i.i464 to float
+ %smearinsert50 = insertelement <4 x float> undef, float %double2float, i32 3
+ %blendAsInt.i503 = bitcast <4 x float> %smearinsert50 to <4 x i32>
+ store <4 x i32> %blendAsInt.i503, <4 x i32>* undef, align 4
+ ret void
+}