1 ; RUN: opt -S -loop-vectorize -force-vector-interleave=1 -force-vector-width=2 < %s 2>&1 | FileCheck %s 2 3 ; CHECK: remark: {{.*}}: loop not vectorized: value could not be identified as an induction or reduction variable 4 5 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" 6 7 @f = common global i32 0, align 4 8 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 9 @c = common global i32 0, align 4 10 @a = common global i32 0, align 4 11 @b = common global i32 0, align 4 12 @e = common global i32 0, align 4 13 14 ; We used to vectorize this loop. But it has a value that is used outside of the 15 ; and is not a recognized reduction variable "tmp17". 16 17 ; CHECK-LABEL: @main( 18 ; CHECK-NOT: <2 x i32> 19 20 define i32 @main() { 21 bb: 22 %b.promoted = load i32, i32* @b, align 4 23 br label %.lr.ph.i 24 25 .lr.ph.i: 26 %tmp8 = phi i32 [ %tmp18, %bb16 ], [ %b.promoted, %bb ] 27 %tmp2 = icmp sgt i32 %tmp8, 10 28 br i1 %tmp2, label %bb16, label %bb10 29 30 bb10: 31 br label %bb16 32 33 bb16: 34 %tmp17 = phi i32 [ 0, %bb10 ], [ 1, %.lr.ph.i ] 35 %tmp18 = add nsw i32 %tmp8, 1 36 %tmp19 = icmp slt i32 %tmp18, 4 37 br i1 %tmp19, label %.lr.ph.i, label %f1.exit.loopexit 38 39 f1.exit.loopexit: 40 %.lcssa = phi i32 [ %tmp17, %bb16 ] 41 ret i32 %.lcssa 42 } 43