Fix MachineLICM to actually visit inner loops.
[oota-llvm.git] / test / CodeGen / X86 / v2f32.ll
1 ; RUN: llc < %s -march=x86-64 -mcpu=penryn -asm-verbose=0 -o - | FileCheck %s -check-prefix=X64
2 ; RUN: llc < %s -mcpu=yonah -march=x86 -asm-verbose=0 -o - | FileCheck %s -check-prefix=X32
3
4 ; PR7518
5 define void @test1(<2 x float> %Q, float *%P2) nounwind {
6   %a = extractelement <2 x float> %Q, i32 0
7   %b = extractelement <2 x float> %Q, i32 1
8   %c = fadd float %a, %b
9
10   store float %c, float* %P2
11   ret void
12 ; X64: test1:
13 ; X64-NEXT: addss       %xmm1, %xmm0
14 ; X64-NEXT: movss       %xmm0, (%rdi)
15 ; X64-NEXT: ret
16
17 ; X32: test1:
18 ; X32-NEXT: movss       4(%esp), %xmm0
19 ; X32-NEXT: addss       8(%esp), %xmm0
20 ; X32-NEXT: movl        12(%esp), %eax
21 ; X32-NEXT: movss       %xmm0, (%eax)
22 ; X32-NEXT: ret
23 }
24
25
26 define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind {
27   %Z = fadd <2 x float> %Q, %R
28   ret <2 x float> %Z
29   
30 ; X64: test2:
31 ; X64-NEXT: insertps $0
32 ; X64-NEXT: insertps $16
33 ; X64-NEXT: insertps $0
34 ; X64-NEXT: insertps $16
35 ; X64-NEXT: addps
36 ; X64-NEXT: movaps
37 ; X64-NEXT: pshufd
38 ; X64-NEXT: ret
39 }