1 ; RUN: opt < %s -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -dce -instcombine -S | FileCheck %s
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"
5 ;CHECK: fadd fast <4 x float>
7 define float @foo(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp {
11 for.body: ; preds = %for.body, %entry
12 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
13 %sum.04 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ]
14 %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv
15 %0 = load float, float* %arrayidx, align 4
16 %add = fadd fast float %sum.04, %0
17 %indvars.iv.next = add i64 %indvars.iv, 1
18 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
19 %exitcond = icmp eq i32 %lftr.wideiv, 200
20 br i1 %exitcond, label %for.end, label %for.body
22 for.end: ; preds = %for.body
26 ;CHECK-LABEL: @foosub(
27 ;CHECK: fsub fast <4 x float>
29 define float @foosub(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp {
33 for.body: ; preds = %for.body, %entry
34 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
35 %sum.04 = phi float [ 0.000000e+00, %entry ], [ %sub, %for.body ]
36 %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv
37 %0 = load float, float* %arrayidx, align 4
38 %sub = fsub fast float %sum.04, %0
39 %indvars.iv.next = add i64 %indvars.iv, 1
40 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
41 %exitcond = icmp eq i32 %lftr.wideiv, 200
42 br i1 %exitcond, label %for.end, label %for.body
44 for.end: ; preds = %for.body