blob: 96c5be4f752f72847cb949b3fdf3366d8718a410 [file] [log] [blame]
Rafael Espindolaae6000e2013-08-23 20:39:19 +00001; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse4.1 | FileCheck %s
Manman Ren5b462822012-11-27 18:09:26 +00002
3; rdar://12721174
4; We should not fold movss into pshufd since pshufd expects m128 while movss
5; loads from m32.
6define void @sample_test(<4 x float>* %source, <2 x float>* %dest) nounwind {
7; CHECK: sample_test
Filipe Cabecinhasdc921022014-05-19 19:45:57 +00008; CHECK-NOT: movaps
Quentin Colombet6bf4baa2013-07-30 00:24:09 +00009; CHECK: insertps
Manman Ren5b462822012-11-27 18:09:26 +000010entry:
11 %source.addr = alloca <4 x float>*, align 8
12 %dest.addr = alloca <2 x float>*, align 8
13 %tmp = alloca <2 x float>, align 8
14 store <4 x float>* %source, <4 x float>** %source.addr, align 8
15 store <2 x float>* %dest, <2 x float>** %dest.addr, align 8
16 store <2 x float> zeroinitializer, <2 x float>* %tmp, align 8
17 %0 = load <4 x float>** %source.addr, align 8
18 %arrayidx = getelementptr inbounds <4 x float>* %0, i64 0
19 %1 = load <4 x float>* %arrayidx, align 16
20 %2 = extractelement <4 x float> %1, i32 0
21 %3 = load <2 x float>* %tmp, align 8
22 %4 = insertelement <2 x float> %3, float %2, i32 1
23 store <2 x float> %4, <2 x float>* %tmp, align 8
24 %5 = load <2 x float>* %tmp, align 8
25 %6 = load <2 x float>** %dest.addr, align 8
26 %arrayidx1 = getelementptr inbounds <2 x float>* %6, i64 0
27 store <2 x float> %5, <2 x float>* %arrayidx1, align 8
28 %7 = load <2 x float>** %dest.addr, align 8
29 %arrayidx2 = getelementptr inbounds <2 x float>* %7, i64 0
30 %8 = load <2 x float>* %arrayidx2, align 8
31 %vecext = extractelement <2 x float> %8, i32 0
32 %9 = load <2 x float>** %dest.addr, align 8
33 %arrayidx3 = getelementptr inbounds <2 x float>* %9, i64 0
34 %10 = load <2 x float>* %arrayidx3, align 8
35 %vecext4 = extractelement <2 x float> %10, i32 1
36 call void @ext(float %vecext, float %vecext4)
37 ret void
38}
39declare void @ext(float, float)