1 ; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
8 ; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH:%.*]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY:%.*]] ]
9 ; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 2, i64 3, i64 4, i64 5>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[VECTOR_BODY]] ]
10 ; CHECK-NEXT: [[OFFSET_IDX:%.*]] = add i64 2, [[INDEX]]
11 ; CHECK-NEXT: [[TMP7:%.*]] = add i64 [[OFFSET_IDX]], 0
12 ; CHECK-NEXT: [[TMP8:%.*]] = add i64 [[OFFSET_IDX]], 1
13 ; CHECK-NEXT: [[TMP9:%.*]] = add i64 [[OFFSET_IDX]], 2
14 ; CHECK-NEXT: [[TMP10:%.*]] = add i64 [[OFFSET_IDX]], 3
15 ; CHECK-NEXT: [[OFFSET_IDX1:%.*]] = add i64 2, [[INDEX]]
16 ; CHECK-NEXT: [[TMP11:%.*]] = trunc i64 [[OFFSET_IDX1]] to i32
17 ; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i32> undef, i32 [[TMP11]], i32 0
18 ; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT]], <4 x i32> undef, <4 x i32> zeroinitializer
19 ; CHECK-NEXT: [[INDUCTION:%.*]] = add <4 x i32> [[BROADCAST_SPLAT]], <i32 0, i32 1, i32 2, i32 3>
20 ; CHECK-NEXT: [[TMP12:%.*]] = add i32 [[TMP11]], 0
21 ; CHECK-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], 4
22 ; CHECK-NEXT: [[VEC_IND_NEXT]] = add <4 x i64> [[VEC_IND]], <i64 4, i64 4, i64 4, i64 4>
23 ; CHECK-NEXT: [[TMP13:%.*]] = icmp eq i64 [[INDEX_NEXT]], 80
24 ; CHECK-NEXT: br i1 [[TMP13]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop !0
30 %0 = phi i64 [ 2, %entry ], [ %3, %loop ]
31 %1 = and i64 %0, 4294967295
32 %2 = trunc i64 %0 to i32
33 %3 = add nuw nsw i64 %1, 1
34 %4 = icmp sgt i32 %2, 80
35 br i1 %4, label %exit, label %loop