xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/fold-load-vec.ll (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse4.1 | FileCheck %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc; rdar://12721174
4f4a2713aSLionel Sambuc; We should not fold movss into pshufd since pshufd expects m128 while movss
5f4a2713aSLionel Sambuc; loads from m32.
6f4a2713aSLionel Sambucdefine void @sample_test(<4 x float>* %source, <2 x float>* %dest) nounwind {
7f4a2713aSLionel Sambuc; CHECK: sample_test
8*0a6a1f1dSLionel Sambuc; CHECK-NOT: movaps
9f4a2713aSLionel Sambuc; CHECK: insertps
10f4a2713aSLionel Sambucentry:
11f4a2713aSLionel Sambuc  %source.addr = alloca <4 x float>*, align 8
12f4a2713aSLionel Sambuc  %dest.addr = alloca <2 x float>*, align 8
13f4a2713aSLionel Sambuc  %tmp = alloca <2 x float>, align 8
14f4a2713aSLionel Sambuc  store <4 x float>* %source, <4 x float>** %source.addr, align 8
15f4a2713aSLionel Sambuc  store <2 x float>* %dest, <2 x float>** %dest.addr, align 8
16f4a2713aSLionel Sambuc  store <2 x float> zeroinitializer, <2 x float>* %tmp, align 8
17f4a2713aSLionel Sambuc  %0 = load <4 x float>** %source.addr, align 8
18f4a2713aSLionel Sambuc  %arrayidx = getelementptr inbounds <4 x float>* %0, i64 0
19f4a2713aSLionel Sambuc  %1 = load <4 x float>* %arrayidx, align 16
20f4a2713aSLionel Sambuc  %2 = extractelement <4 x float> %1, i32 0
21f4a2713aSLionel Sambuc  %3 = load <2 x float>* %tmp, align 8
22f4a2713aSLionel Sambuc  %4 = insertelement <2 x float> %3, float %2, i32 1
23f4a2713aSLionel Sambuc  store <2 x float> %4, <2 x float>* %tmp, align 8
24f4a2713aSLionel Sambuc  %5 = load <2 x float>* %tmp, align 8
25f4a2713aSLionel Sambuc  %6 = load <2 x float>** %dest.addr, align 8
26f4a2713aSLionel Sambuc  %arrayidx1 = getelementptr inbounds <2 x float>* %6, i64 0
27f4a2713aSLionel Sambuc  store <2 x float> %5, <2 x float>* %arrayidx1, align 8
28f4a2713aSLionel Sambuc  %7 = load <2 x float>** %dest.addr, align 8
29f4a2713aSLionel Sambuc  %arrayidx2 = getelementptr inbounds <2 x float>* %7, i64 0
30f4a2713aSLionel Sambuc  %8 = load <2 x float>* %arrayidx2, align 8
31f4a2713aSLionel Sambuc  %vecext = extractelement <2 x float> %8, i32 0
32f4a2713aSLionel Sambuc  %9 = load <2 x float>** %dest.addr, align 8
33f4a2713aSLionel Sambuc  %arrayidx3 = getelementptr inbounds <2 x float>* %9, i64 0
34f4a2713aSLionel Sambuc  %10 = load <2 x float>* %arrayidx3, align 8
35f4a2713aSLionel Sambuc  %vecext4 = extractelement <2 x float> %10, i32 1
36f4a2713aSLionel Sambuc  call void @ext(float %vecext, float %vecext4)
37f4a2713aSLionel Sambuc  ret void
38f4a2713aSLionel Sambuc}
39f4a2713aSLionel Sambucdeclare void @ext(float, float)
40