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 O1-pr41008.c
4 ; opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars -instnamer O1-pr41008.s > O1-pr41008.ll
6 ; ModuleID = 'O1-pr41008.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 @heating = common global [2 x [2 x double]] zeroinitializer, align 16
12 define void @map_do() nounwind uwtable {
16 for.cond: ; preds = %for.inc14, %entry
17 %indvar1 = phi i64 [ %indvar.next2, %for.inc14 ], [ 0, %entry ]
18 %ksav.0 = phi i32 [ undef, %entry ], [ %ksav.1.lcssa, %for.inc14 ]
19 %jsav.0 = phi i32 [ undef, %entry ], [ %jsav.1.lcssa, %for.inc14 ]
20 %k.0 = trunc i64 %indvar1 to i32
21 %exitcond3 = icmp ne i64 %indvar1, 2
22 br i1 %exitcond3, label %for.body, label %for.end17
24 for.body: ; preds = %for.cond
27 for.cond1: ; preds = %for.inc, %for.body
28 %indvar = phi i64 [ %indvar.next, %for.inc ], [ 0, %for.body ]
29 %ksav.1 = phi i32 [ %ksav.0, %for.body ], [ %ksav.2, %for.inc ]
30 %jsav.1 = phi i32 [ %jsav.0, %for.body ], [ %jsav.2, %for.inc ]
31 %arrayidx8 = getelementptr [2 x [2 x double]]* @heating, i64 0, i64 %indvar1, i64 %indvar
32 %j.0 = trunc i64 %indvar to i32
33 %exitcond = icmp ne i64 %indvar, 2
34 br i1 %exitcond, label %for.body4, label %for.end
36 for.body4: ; preds = %for.cond1
37 %tmp9 = load double* %arrayidx8, align 8
38 %cmp10 = fcmp ogt double %tmp9, 0.000000e+00
39 br i1 %cmp10, label %if.then, label %if.end
41 if.then: ; preds = %for.body4
44 if.end: ; preds = %if.then, %for.body4
45 %ksav.2 = phi i32 [ %k.0, %if.then ], [ %ksav.1, %for.body4 ]
46 %jsav.2 = phi i32 [ %j.0, %if.then ], [ %jsav.1, %for.body4 ]
49 for.inc: ; preds = %if.end
50 %indvar.next = add i64 %indvar, 1
53 for.end: ; preds = %for.cond1
54 %jsav.1.lcssa = phi i32 [ %jsav.1, %for.cond1 ]
55 %ksav.1.lcssa = phi i32 [ %ksav.1, %for.cond1 ]
58 for.inc14: ; preds = %for.end
59 %indvar.next2 = add i64 %indvar1, 1
62 for.end17: ; preds = %for.cond
63 %jsav.0.lcssa = phi i32 [ %jsav.0, %for.cond ]
64 %ksav.0.lcssa = phi i32 [ %ksav.0, %for.cond ]
65 call void @foo(i32 %jsav.0.lcssa, i32 %ksav.0.lcssa) nounwind
69 declare void @foo(i32, i32)