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 O3-pr36098.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer O3-pr36098.s > O3-pr36098.ll
6 ; ModuleID = 'O3-pr36098.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.t_sortblock = type { [3 x i32], i32 }
12 define void @foo(i32 %ncons, %struct.t_sortblock* %sb, i32* %iatom) nounwind uwtable {
14 %tmp5 = icmp sgt i32 %ncons, 0
15 %smax = select i1 %tmp5, i32 %ncons, i32 0
16 %tmp6 = zext i32 %smax to i64
19 for.cond: ; preds = %for.inc18, %entry
20 %indvar1 = phi i64 [ %indvar.next2, %for.inc18 ], [ 0, %entry ]
21 %tmp8 = mul i64 %indvar1, 3
22 %exitcond7 = icmp ne i64 %indvar1, %tmp6
23 br i1 %exitcond7, label %for.body, label %for.end22
25 for.body: ; preds = %for.cond
28 for.cond2: ; preds = %for.inc, %for.body
29 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body ]
30 %arrayidx11 = getelementptr %struct.t_sortblock* %sb, i64 %indvar1, i32 0, i64 %indvar
31 %tmp9 = add i64 %tmp8, %indvar
32 %arrayidx16 = getelementptr i32* %iatom, i64 %tmp9
33 %exitcond = icmp ne i64 %indvar, 3
34 br i1 %exitcond, label %for.body5, label %for.end
36 for.body5: ; preds = %for.cond2
37 %tmp12 = load i32* %arrayidx11, align 4
38 store i32 %tmp12, i32* %arrayidx16, align 4
41 for.inc: ; preds = %for.body5
42 %indvar.next = add i64 %indvar, 1
45 for.end: ; preds = %for.cond2
48 for.inc18: ; preds = %for.end
49 %indvar.next2 = add i64 %indvar1, 1
52 for.end22: ; preds = %for.cond