1 ; This test verifies that the loop vectorizer will NOT produce a tail
2 ; loop with Optimize for size attibute.
4 ; RUN: opt < %s -loop-vectorize -debug -debug-only=loop-vectorize -S 2>&1 | FileCheck %s
8 ; CHECK: Aborting. A tail loop is required in Os.
10 target datalayout = "E-m:e-p:32:32-i64:32-f64:32:64-a:0:32-n32-S128"
12 @tab = common global [32 x i8] zeroinitializer, align 1
14 define i32 @foo() #0 {
18 for.body: ; preds = %for.body, %entry
19 %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
20 %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @tab, i32 0, i32 %i.08
21 %0 = load i8, i8* %arrayidx, align 1
22 %cmp1 = icmp eq i8 %0, 0
23 %. = select i1 %cmp1, i8 2, i8 1
24 store i8 %., i8* %arrayidx, align 1
25 %inc = add nsw i32 %i.08, 1
26 %exitcond = icmp eq i32 %i.08, 202
27 br i1 %exitcond, label %for.end, label %for.body
29 for.end: ; preds = %for.body
33 attributes #0 = { optsize }