1*cee313d2SEric Christopher; RUN: opt < %s  -loop-vectorize -mtriple=thumbv7-apple-ios3.0.0 -S | FileCheck %s
2*cee313d2SEric Christopher
3*cee313d2SEric Christophertarget datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
4*cee313d2SEric Christophertarget triple = "thumbv7-apple-ios3.0.0"
5*cee313d2SEric Christopher
6*cee313d2SEric Christopher;CHECK:foo_F32
7*cee313d2SEric Christopher;CHECK: <4 x float>
8*cee313d2SEric Christopher;CHECK:ret
9*cee313d2SEric Christopherdefine float @foo_F32(float* nocapture %A, i32 %n) nounwind uwtable readonly ssp {
10*cee313d2SEric Christopher  %1 = icmp sgt i32 %n, 0
11*cee313d2SEric Christopher  br i1 %1, label %.lr.ph, label %._crit_edge
12*cee313d2SEric Christopher
13*cee313d2SEric Christopher.lr.ph:                                           ; preds = %0, %.lr.ph
14*cee313d2SEric Christopher  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
15*cee313d2SEric Christopher  %prod.01 = phi float [ %4, %.lr.ph ], [ 0.000000e+00, %0 ]
16*cee313d2SEric Christopher  %2 = getelementptr inbounds float, float* %A, i64 %indvars.iv
17*cee313d2SEric Christopher  %3 = load float, float* %2, align 8
18*cee313d2SEric Christopher  %4 = fmul fast float %prod.01, %3
19*cee313d2SEric Christopher  %indvars.iv.next = add i64 %indvars.iv, 1
20*cee313d2SEric Christopher  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
21*cee313d2SEric Christopher  %exitcond = icmp eq i32 %lftr.wideiv, %n
22*cee313d2SEric Christopher  br i1 %exitcond, label %._crit_edge, label %.lr.ph
23*cee313d2SEric Christopher
24*cee313d2SEric Christopher._crit_edge:                                      ; preds = %.lr.ph, %0
25*cee313d2SEric Christopher  %prod.0.lcssa = phi float [ 0.000000e+00, %0 ], [ %4, %.lr.ph ]
26*cee313d2SEric Christopher  ret float %prod.0.lcssa
27*cee313d2SEric Christopher}
28*cee313d2SEric Christopher
29*cee313d2SEric Christopher;CHECK:foo_I8
30*cee313d2SEric Christopher;CHECK: xor <16 x i8>
31*cee313d2SEric Christopher;CHECK:ret
32*cee313d2SEric Christopherdefine signext i8 @foo_I8(i8* nocapture %A, i32 %n) nounwind uwtable readonly ssp {
33*cee313d2SEric Christopher  %1 = icmp sgt i32 %n, 0
34*cee313d2SEric Christopher  br i1 %1, label %.lr.ph, label %._crit_edge
35*cee313d2SEric Christopher
36*cee313d2SEric Christopher.lr.ph:                                           ; preds = %0, %.lr.ph
37*cee313d2SEric Christopher  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
38*cee313d2SEric Christopher  %red.01 = phi i8 [ %4, %.lr.ph ], [ 0, %0 ]
39*cee313d2SEric Christopher  %2 = getelementptr inbounds i8, i8* %A, i64 %indvars.iv
40*cee313d2SEric Christopher  %3 = load i8, i8* %2, align 1
41*cee313d2SEric Christopher  %4 = xor i8 %3, %red.01
42*cee313d2SEric Christopher  %indvars.iv.next = add i64 %indvars.iv, 1
43*cee313d2SEric Christopher  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
44*cee313d2SEric Christopher  %exitcond = icmp eq i32 %lftr.wideiv, %n
45*cee313d2SEric Christopher  br i1 %exitcond, label %._crit_edge, label %.lr.ph
46*cee313d2SEric Christopher
47*cee313d2SEric Christopher._crit_edge:                                      ; preds = %.lr.ph, %0
48*cee313d2SEric Christopher  %red.0.lcssa = phi i8 [ 0, %0 ], [ %4, %.lr.ph ]
49*cee313d2SEric Christopher  ret i8 %red.0.lcssa
50*cee313d2SEric Christopher}
51*cee313d2SEric Christopher
52*cee313d2SEric Christopher
53