Home | History | Annotate | Download | only in LoopVectorize
      1 ; RUN: opt < %s  -loop-vectorize -force-vector-unroll=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* %A, i64 %indvars.iv
     16   %0 = load 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