1 ; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-vector -dce -S %s | FileCheck %s
2 ; Obtained from C source as:
3 ; clang -S -emit-llvm -O0 vect-33.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer vect-33.s > vect-33.ll
6 ; ModuleID = 'vect-33.s'
7 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
8 target triple = "x86_64-unknown-linux-gnu"
10 %struct.test = type { [16 x i8] }
12 @s = external global %struct.test
14 define i32 @main1() nounwind uwtable noinline {
18 for.cond: ; preds = %for.inc, %entry
19 %indvar1 = phi i64 [ %indvar.next2, %for.inc ], [ 0, %entry ]
20 %arrayidx = getelementptr %struct.test* @s, i64 0, i32 0, i64 %indvar1
21 %exitcond = icmp ne i64 %indvar1, 16
22 br i1 %exitcond, label %for.body, label %for.end
24 for.body: ; preds = %for.cond
25 store i8 5, i8* %arrayidx, align 1
28 for.inc: ; preds = %for.body
29 %indvar.next2 = add i64 %indvar1, 1
32 for.end: ; preds = %for.cond
35 for.cond3: ; preds = %for.inc13, %for.end
36 %indvar = phi i64 [ %indvar.next, %for.inc13 ], [ 0, %for.end ]
37 %arrayidx9 = getelementptr %struct.test* @s, i64 0, i32 0, i64 %indvar
38 %i.1 = trunc i64 %indvar to i32
39 %cmp5 = icmp slt i32 %i.1, 16
40 br i1 %cmp5, label %for.body6, label %for.end16
42 for.body6: ; preds = %for.cond3
43 %tmp10 = load i8* %arrayidx9, align 1
44 %cmp11 = icmp eq i8 %tmp10, 5
45 br i1 %cmp11, label %if.end, label %if.then
47 if.then: ; preds = %for.body6
48 call void @abort() noreturn nounwind
51 if.end: ; preds = %for.body6
54 for.inc13: ; preds = %if.end
55 %indvar.next = add i64 %indvar, 1
58 for.end16: ; preds = %for.cond3
62 declare void @abort() noreturn
64 define i32 @main() nounwind uwtable {
66 %call = call i32 @main1()