1 ; This test makes sure that loop will not be unrolled in vectorization if VF computed
3 ; RUN: opt < %s -loop-vectorize -S | FileCheck %s
5 ; Make sure there are no geps being merged.
8 ; CHECK-NOT: getelementptr
10 @N = common global i32 0, align 4
11 @a = common global [1000 x i32] zeroinitializer, align 16
13 define void @foo() #0 {
15 %0 = load i32, i32* @N, align 4
16 %cmp5 = icmp sgt i32 %0, 0
17 br i1 %cmp5, label %for.body.lr.ph, label %for.end
19 for.body.lr.ph: ; preds = %entry
20 %conv = sext i32 %0 to i64
23 for.body: ; preds = %for.body.lr.ph, %for.body
24 %i.06 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
25 %mul = mul nuw nsw i64 %i.06, 7
26 %arrayidx = getelementptr inbounds [1000 x i32], [1000 x i32]* @a, i64 0, i64 %mul
27 store i32 3, i32* %arrayidx, align 4
28 %inc = add nuw nsw i64 %i.06, 1
29 %cmp = icmp slt i64 %inc, %conv
30 br i1 %cmp, label %for.body, label %for.end.loopexit
32 for.end.loopexit: ; preds = %for.body
35 for.end: ; preds = %for.end.loopexit, %entry