1 ; RUN: opt -S %loadPolly -basic-aa -polly-dependences-analysis-type=value-based -polly-dce -polly-dce-precise-steps=2 -polly-print-ast -disable-output < %s | FileCheck %s
2 ; RUN: opt -S %loadNPMPolly "-passes=scop(polly-dce,print<polly-ast>)" -polly-dependences-analysis-type=value-based -polly-dce-precise-steps=2 < %s | FileCheck %s
3 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"
5 ; for(i = 0; i < 200; i++ )
8 ; for (i = 0; i < 50; i++ )
11 ; for (i = 0; i < 70; i++ )
14 ; for (i = 100; i < 110; i++ )
17 define void @main() nounwind uwtable {
19 %A = alloca [200 x i32], align 16
23 %indvar.1 = phi i64 [ 0, %entry ], [ %indvar.next.1, %for.body.1 ]
24 %arrayidx.1 = getelementptr [200 x i32], ptr %A, i64 0, i64 %indvar.1
25 store i32 2, ptr %arrayidx.1, align 4
26 %indvar.next.1 = add i64 %indvar.1, 1
27 %exitcond.1 = icmp ne i64 %indvar.next.1, 200
28 br i1 %exitcond.1, label %for.body.1, label %exit.1
34 %indvar.2 = phi i64 [ 0, %exit.1 ], [ %indvar.next.2, %for.body.2 ]
35 %arrayidx.2 = getelementptr [200 x i32], ptr %A, i64 0, i64 %indvar.2
36 store i32 5, ptr %arrayidx.2, align 4
37 %indvar.next.2 = add i64 %indvar.2, 1
38 %exitcond.2 = icmp ne i64 %indvar.next.2, 50
39 br i1 %exitcond.2, label %for.body.2, label %exit.2
45 %indvar.3 = phi i64 [ 0, %exit.2 ], [ %indvar.next.3, %for.body.3 ]
46 %arrayidx.3 = getelementptr [200 x i32], ptr %A, i64 0, i64 %indvar.3
47 %val = load i32, ptr %arrayidx.3, align 4
48 %add = add nsw i32 %val, 5
49 store i32 %add, ptr %arrayidx.3, align 4
50 %indvar.next.3 = add i64 %indvar.3, 1
51 %exitcond.3 = icmp ne i64 %indvar.next.3, 70
52 br i1 %exitcond.3, label %for.body.3 , label %exit.3
58 %indvar.4 = phi i64 [ 0, %exit.3 ], [ %indvar.next.4, %for.body.4 ]
59 %indvar.plus = add i64 %indvar.4, 100
60 %trunc = trunc i64 %indvar.plus to i32
61 %arrayidx.4 = getelementptr [200 x i32], ptr %A, i64 0, i64 %indvar.plus
62 store i32 %trunc, ptr %arrayidx.4, align 4
63 %indvar.next.4 = add i64 %indvar.4, 1
64 %exitcond.4 = icmp ne i64 %indvar.next.4, 10
65 br i1 %exitcond.4, label %for.body.4, label %exit.4
71 ; CHECK: for (int c0 = 50; c0 <= 99; c0 += 1)
72 ; CHECK: Stmt_for_body_1(c0);
73 ; CHECK: for (int c0 = 110; c0 <= 199; c0 += 1)
74 ; CHECK: Stmt_for_body_1(c0);
75 ; CHECK: for (int c0 = 0; c0 <= 49; c0 += 1)
76 ; CHECK: Stmt_for_body_2(c0);
77 ; CHECK: for (int c0 = 0; c0 <= 69; c0 += 1)
78 ; CHECK: Stmt_for_body_3(c0);
79 ; CHECK: for (int c0 = 0; c0 <= 9; c0 += 1)