58 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-- -mattr=+sse2 | FileCheck %s3 4define float @foo(ptr %x, ptr %y, i32 %c) nounwind {5; CHECK-LABEL: foo:6; CHECK: # %bb.0: # %entry7; CHECK-NEXT: pushl %esi8; CHECK-NEXT: pushl %eax9; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax10; CHECK-NEXT: testl %eax, %eax11; CHECK-NEXT: je .LBB0_112; CHECK-NEXT: # %bb.2: # %bb18.preheader13; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx14; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx15; CHECK-NEXT: xorps %xmm0, %xmm016; CHECK-NEXT: xorl %esi, %esi17; CHECK-NEXT: .p2align 418; CHECK-NEXT: .LBB0_3: # %bb1819; CHECK-NEXT: # =>This Inner Loop Header: Depth=120; CHECK-NEXT: xorps %xmm1, %xmm121; CHECK-NEXT: cvtsi2ssl (%edx,%esi,4), %xmm122; CHECK-NEXT: mulss (%ecx,%esi,4), %xmm123; CHECK-NEXT: addss %xmm1, %xmm024; CHECK-NEXT: incl %esi25; CHECK-NEXT: cmpl %eax, %esi26; CHECK-NEXT: jb .LBB0_327; CHECK-NEXT: jmp .LBB0_428; CHECK-NEXT: .LBB0_1:29; CHECK-NEXT: xorps %xmm0, %xmm030; CHECK-NEXT: .LBB0_4: # %bb2331; CHECK-NEXT: movss %xmm0, (%esp)32; CHECK-NEXT: flds (%esp)33; CHECK-NEXT: addl $4, %esp34; CHECK-NEXT: popl %esi35; CHECK-NEXT: retl36entry:37 %tmp2132 = icmp eq i32 %c, 0 ; <i1> [#uses=1]38 br i1 %tmp2132, label %bb23, label %bb1839 40bb18: ; preds = %bb18, %entry41 %i.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %tmp17, %bb18 ] ; <i32> [#uses=3]42 %res.0.reg2mem.0 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb18 ] ; <float> [#uses=1]43 %tmp3 = getelementptr i32, ptr %x, i32 %i.0.reg2mem.0 ; <ptr> [#uses=1]44 %tmp4 = load i32, ptr %tmp3, align 4 ; <i32> [#uses=1]45 %tmp45 = sitofp i32 %tmp4 to float ; <float> [#uses=1]46 %tmp8 = getelementptr float, ptr %y, i32 %i.0.reg2mem.0 ; <ptr> [#uses=1]47 %tmp9 = load float, ptr %tmp8, align 4 ; <float> [#uses=1]48 %tmp11 = fmul float %tmp9, %tmp45 ; <float> [#uses=1]49 %tmp14 = fadd float %tmp11, %res.0.reg2mem.0 ; <float> [#uses=2]50 %tmp17 = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]51 %tmp21 = icmp ult i32 %tmp17, %c ; <i1> [#uses=1]52 br i1 %tmp21, label %bb18, label %bb2353 54bb23: ; preds = %bb18, %entry55 %res.0.reg2mem.1 = phi float [ 0.000000e+00, %entry ], [ %tmp14, %bb18 ] ; <float> [#uses=1]56 ret float %res.0.reg2mem.157}58