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"
6 ; Check that the need for overflow check prevents vectorizing a loop with tiny
7 ; trip count (which implies opt for size).
8 ; CHECK-LABEL: @func_34
9 ; CHECK-NOT: vector.scevcheck
10 ; CHECK-NOT: vector.body:
12 define void @func_34() {
17 %storemerge2 = phi i32 [ 0, %bb1 ], [ %_tmp2300, %bb67 ]
18 %sext = shl i32 %storemerge2, 16
19 %_tmp2299 = ashr exact i32 %sext, 16
20 %_tmp2300 = add nsw i32 %_tmp2299, 1
21 %_tmp2310 = trunc i32 %_tmp2300 to i16
22 %_tmp2312 = icmp slt i16 %_tmp2310, 3
23 br i1 %_tmp2312, label %bb67, label %bb68
29 ; Check that the need for stride==1 check prevents vectorizing a loop under opt
31 ; CHECK-LABEL: @scev4stride1
32 ; CHECK-NOT: vector.scevcheck
33 ; CHECK-NOT: vector.body:
34 ; CHECK-LABEL: for.body:
35 define void @scev4stride1(i32* noalias nocapture %a, i32* noalias nocapture readonly %b, i32 %k) #0 {
40 %i.07 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
41 %mul = mul nsw i32 %i.07, %k
42 %arrayidx = getelementptr inbounds i32, i32* %b, i32 %mul
43 %0 = load i32, i32* %arrayidx, align 4
44 %arrayidx1 = getelementptr inbounds i32, i32* %a, i32 %i.07
45 store i32 %0, i32* %arrayidx1, align 4
46 %inc = add nuw nsw i32 %i.07, 1
47 %exitcond = icmp eq i32 %inc, 1024
48 br i1 %exitcond, label %for.end.loopexit, label %for.body
54 attributes #0 = { optsize }