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 6 ;CHECK: add_ints 7 ;CHECK: br 8 ;CHECK: getelementptr 9 ;CHECK-NEXT: getelementptr 10 ;CHECK-NEXT: icmp uge 11 ;CHECK-NEXT: icmp uge 12 ;CHECK-NEXT: icmp uge 13 ;CHECK-NEXT: icmp uge 14 ;CHECK-NEXT: and 15 ;CHECK: ret 16 define void @add_ints(i32* nocapture %A, i32* nocapture %B, i32* nocapture %C) { 17 entry: 18 br label %for.body 19 20 for.body: 21 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] 22 %arrayidx = getelementptr inbounds i32* %B, i64 %indvars.iv 23 %0 = load i32* %arrayidx, align 4 24 %arrayidx2 = getelementptr inbounds i32* %C, i64 %indvars.iv 25 %1 = load i32* %arrayidx2, align 4 26 %add = add nsw i32 %1, %0 27 %arrayidx4 = getelementptr inbounds i32* %A, i64 %indvars.iv 28 store i32 %add, i32* %arrayidx4, align 4 29 %indvars.iv.next = add i64 %indvars.iv, 1 30 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 31 %exitcond = icmp eq i32 %lftr.wideiv, 200 32 br i1 %exitcond, label %for.end, label %for.body 33 34 for.end: 35 ret void 36 } 37