1 ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine -S | FileCheck %s 2 3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" 4 target triple = "x86_64-apple-macosx10.8.0" 5 ;CHECK-LABEL: @foo( 6 ;CHECK: fadd fast <4 x float> 7 ;CHECK: ret 8 define float @foo(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp { 9 entry: 10 br label %for.body 11 12 for.body: ; preds = %for.body, %entry 13 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] 14 %sum.04 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] 15 %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv 16 %0 = load float, float* %arrayidx, align 4 17 %add = fadd fast float %sum.04, %0 18 %indvars.iv.next = add i64 %indvars.iv, 1 19 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 20 %exitcond = icmp eq i32 %lftr.wideiv, 200 21 br i1 %exitcond, label %for.end, label %for.body 22 23 for.end: ; preds = %for.body 24 ret float %add 25 } 26 27 ;CHECK-LABEL: @foosub( 28 ;CHECK: fsub fast <4 x float> 29 ;CHECK: ret 30 define float @foosub(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp { 31 entry: 32 br label %for.body 33 34 for.body: ; preds = %for.body, %entry 35 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] 36 %sum.04 = phi float [ 0.000000e+00, %entry ], [ %sub, %for.body ] 37 %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv 38 %0 = load float, float* %arrayidx, align 4 39 %sub = fsub fast float %sum.04, %0 40 %indvars.iv.next = add i64 %indvars.iv, 1 41 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 42 %exitcond = icmp eq i32 %lftr.wideiv, 200 43 br i1 %exitcond, label %for.end, label %for.body 44 45 for.end: ; preds = %for.body 46 ret float %sub 47 } 48