1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=corei7-avx -mattr=+sse2 | FileCheck %s
5 @NNTOT = weak global i32 0 ; <ptr> [#uses=1]
6 @G = weak global float 0.000000e+00 ; <ptr> [#uses=1]
8 define void @runcont(ptr %source) nounwind {
9 ; CHECK-LABEL: runcont:
10 ; CHECK: ## %bb.0: ## %entry
11 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
12 ; CHECK-NEXT: movl L_NNTOT$non_lazy_ptr, %ecx
13 ; CHECK-NEXT: movl (%ecx), %ecx
14 ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
15 ; CHECK-NEXT: xorl %edx, %edx
16 ; CHECK-NEXT: .p2align 4, 0x90
17 ; CHECK-NEXT: LBB0_1: ## %bb
18 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
19 ; CHECK-NEXT: vcvtsi2ssl (%eax,%edx,4), %xmm2, %xmm1
20 ; CHECK-NEXT: vaddss %xmm0, %xmm1, %xmm0
21 ; CHECK-NEXT: incl %edx
22 ; CHECK-NEXT: cmpl %edx, %ecx
23 ; CHECK-NEXT: jne LBB0_1
24 ; CHECK-NEXT: ## %bb.2: ## %bb13
25 ; CHECK-NEXT: movl L_G$non_lazy_ptr, %eax
26 ; CHECK-NEXT: vmovss %xmm0, (%eax)
29 %tmp10 = load i32, ptr @NNTOT, align 4 ; <i32> [#uses=1]
32 bb: ; preds = %bb, %entry
33 %neuron.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
34 %thesum.0 = phi float [ 0.000000e+00, %entry ], [ %tmp6, %bb ] ; <float> [#uses=1]
35 %tmp2 = getelementptr i32, ptr %source, i32 %neuron.0 ; <ptr> [#uses=1]
36 %tmp3 = load i32, ptr %tmp2, align 4 ; <i32> [#uses=1]
37 %tmp34 = sitofp i32 %tmp3 to float ; <float> [#uses=1]
38 %tmp6 = fadd float %tmp34, %thesum.0 ; <float> [#uses=2]
39 %indvar.next = add i32 %neuron.0, 1 ; <i32> [#uses=2]
40 %exitcond = icmp eq i32 %indvar.next, %tmp10 ; <i1> [#uses=1]
41 br i1 %exitcond, label %bb13, label %bb
44 store volatile float %tmp6, ptr @G, align 4