summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/fold-load-vec.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-04-08 18:41:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-04-08 18:41:23 +0000
commit4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 (patch)
tree06099edc18d30894081a822b756f117cbe0b8207 /test/CodeGen/X86/fold-load-vec.ll
parent482e7bddf617ae804dc47133cb07eb4aa81e45de (diff)
downloadsrc-test-4a16efa3e43e35f0cc9efe3a67f620f0017c3d36.tar.gz
src-test-4a16efa3e43e35f0cc9efe3a67f620f0017c3d36.zip
Notes
Diffstat (limited to 'test/CodeGen/X86/fold-load-vec.ll')
-rw-r--r--test/CodeGen/X86/fold-load-vec.ll39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fold-load-vec.ll b/test/CodeGen/X86/fold-load-vec.ll
new file mode 100644
index 0000000000000..c1756d5e2e1ad
--- /dev/null
+++ b/test/CodeGen/X86/fold-load-vec.ll
@@ -0,0 +1,39 @@
+; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse41 | FileCheck %s
+
+; rdar://12721174
+; We should not fold movss into pshufd since pshufd expects m128 while movss
+; loads from m32.
+define void @sample_test(<4 x float>* %source, <2 x float>* %dest) nounwind {
+; CHECK: sample_test
+; CHECK: movss
+; CHECK: pshufd
+entry:
+ %source.addr = alloca <4 x float>*, align 8
+ %dest.addr = alloca <2 x float>*, align 8
+ %tmp = alloca <2 x float>, align 8
+ store <4 x float>* %source, <4 x float>** %source.addr, align 8
+ store <2 x float>* %dest, <2 x float>** %dest.addr, align 8
+ store <2 x float> zeroinitializer, <2 x float>* %tmp, align 8
+ %0 = load <4 x float>** %source.addr, align 8
+ %arrayidx = getelementptr inbounds <4 x float>* %0, i64 0
+ %1 = load <4 x float>* %arrayidx, align 16
+ %2 = extractelement <4 x float> %1, i32 0
+ %3 = load <2 x float>* %tmp, align 8
+ %4 = insertelement <2 x float> %3, float %2, i32 1
+ store <2 x float> %4, <2 x float>* %tmp, align 8
+ %5 = load <2 x float>* %tmp, align 8
+ %6 = load <2 x float>** %dest.addr, align 8
+ %arrayidx1 = getelementptr inbounds <2 x float>* %6, i64 0
+ store <2 x float> %5, <2 x float>* %arrayidx1, align 8
+ %7 = load <2 x float>** %dest.addr, align 8
+ %arrayidx2 = getelementptr inbounds <2 x float>* %7, i64 0
+ %8 = load <2 x float>* %arrayidx2, align 8
+ %vecext = extractelement <2 x float> %8, i32 0
+ %9 = load <2 x float>** %dest.addr, align 8
+ %arrayidx3 = getelementptr inbounds <2 x float>* %9, i64 0
+ %10 = load <2 x float>* %arrayidx3, align 8
+ %vecext4 = extractelement <2 x float> %10, i32 1
+ call void @ext(float %vecext, float %vecext4)
+ ret void
+}
+declare void @ext(float, float)