1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=corei7 | FileCheck %s
6 define void @foo(ptr nocapture %P) nounwind {
8 ; CHECK: ## %bb.0: ## %entry
9 ; CHECK-NEXT: pushl %esi
10 ; CHECK-NEXT: subl $24, %esp
11 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
12 ; CHECK-NEXT: calll _test
13 ; CHECK-NEXT: fstpl {{[0-9]+}}(%esp)
14 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
15 ; CHECK-NEXT: movsd %xmm0, (%esp) ## 8-byte Spill
16 ; CHECK-NEXT: calll _test
17 ; CHECK-NEXT: fstpl {{[0-9]+}}(%esp)
18 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
19 ; CHECK-NEXT: movsd (%esp), %xmm1 ## 8-byte Reload
20 ; CHECK-NEXT: ## xmm1 = mem[0],zero
21 ; CHECK-NEXT: mulsd %xmm1, %xmm1
22 ; CHECK-NEXT: mulsd %xmm0, %xmm0
23 ; CHECK-NEXT: addsd %xmm1, %xmm0
24 ; CHECK-NEXT: movsd %xmm0, (%esi)
25 ; CHECK-NEXT: addl $24, %esp
26 ; CHECK-NEXT: popl %esi
29 %0 = tail call double (...) @test() nounwind ; <double> [#uses=2]
30 %1 = tail call double (...) @test() nounwind ; <double> [#uses=2]
31 %2 = fmul double %0, %0 ; <double> [#uses=1]
32 %3 = fmul double %1, %1 ; <double> [#uses=1]
33 %4 = fadd double %2, %3 ; <double> [#uses=1]
34 store double %4, ptr %P, align 8
38 declare double @test(...)