1 ; RUN: opt < %s -loop-vectorize -mtriple=thumbv7-apple-ios3.0.0 -S | FileCheck %s 2 ; RUN: opt < %s -loop-vectorize -mtriple=thumbv7-apple-ios3.0.0 -mcpu=swift -S | FileCheck %s --check-prefix=SWIFT 3 4 target 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" 5 target triple = "thumbv7-apple-ios3.0.0" 6 7 ;CHECK-LABEL: @foo( 8 ;CHECK: load <4 x i32> 9 ;CHECK-NOT: load <4 x i32> 10 ;CHECK: ret 11 ;SWIFT-LABEL: @foo( 12 ;SWIFT: load <4 x i32> 13 ;SWIFT: load <4 x i32> 14 ;SWIFT: ret 15 define i32 @foo(i32* nocapture %A, i32 %n) nounwind readonly ssp { 16 %1 = icmp sgt i32 %n, 0 17 br i1 %1, label %.lr.ph, label %._crit_edge 18 19 .lr.ph: ; preds = %0, %.lr.ph 20 %i.02 = phi i32 [ %5, %.lr.ph ], [ 0, %0 ] 21 %sum.01 = phi i32 [ %4, %.lr.ph ], [ 0, %0 ] 22 %2 = getelementptr inbounds i32* %A, i32 %i.02 23 %3 = load i32* %2, align 4 24 %4 = add nsw i32 %3, %sum.01 25 %5 = add nsw i32 %i.02, 1 26 %exitcond = icmp eq i32 %5, %n 27 br i1 %exitcond, label %._crit_edge, label %.lr.ph 28 29 ._crit_edge: ; preds = %.lr.ph, %0 30 %sum.0.lcssa = phi i32 [ 0, %0 ], [ %4, %.lr.ph ] 31 ret i32 %sum.0.lcssa 32 } 33