1 ; RUN: opt -passes=loop-vectorize -force-vector-interleave=1 -S -mcpu=core-avx2
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 @b = common global [256 x i32] zeroinitializer, align 16
7 @a = common global [256 x i32] zeroinitializer, align 16
9 ; unsigned int a[256], b[256];
11 ; for (i = 0; i < 256; i++) {
18 ; CHECK: load <8 x i32>
19 ; CHECK: icmp ugt <8 x i32>
26 for.body: ; preds = %for.inc, %entry
27 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
28 %arrayidx = getelementptr inbounds [256 x i32], ptr @b, i64 0, i64 %indvars.iv
29 %0 = load i32, ptr %arrayidx, align 4
30 %arrayidx2 = getelementptr inbounds [256 x i32], ptr @a, i64 0, i64 %indvars.iv
31 %1 = load i32, ptr %arrayidx2, align 4
32 %cmp3 = icmp ugt i32 %0, %1
33 br i1 %cmp3, label %if.then, label %for.inc
35 if.then: ; preds = %for.body
36 store i32 %0, ptr %arrayidx2, align 4
39 for.inc: ; preds = %for.body, %if.then
40 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
41 %exitcond = icmp eq i64 %indvars.iv.next, 256
42 br i1 %exitcond, label %for.end, label %for.body
44 for.end: ; preds = %for.inc