[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.
[polly-mirror.git] / test / Isl / single_loop_param_less_equal.ll
blob02013b8f991b9b8e417df69dd73dc28c326f2706
1 ; RUN: opt %loadPolly -polly-ast -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-codegen  -S < %s | FileCheck %s -check-prefix=CODEGEN
3 ; RUN: opt %loadPolly -polly-codegen -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
4 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"
6 @A = common global [1024 x i32] zeroinitializer
8 define void @bar(i64 %n) {
9 start:
10   %n_plus_one = add i64 %n, 1
11   fence seq_cst
12   br label %loop.header
14 loop.header:
15   %i = phi i64 [ 0, %start ], [ %i.next, %loop.backedge ]
16   %scevgep = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %i
17   %exitcond = icmp ne i64 %i, %n_plus_one
18   br i1 %exitcond, label %loop.body, label %ret
20 loop.body:
21   store i32 1, i32* %scevgep
22   br label %loop.backedge
24 loop.backedge:
25   %i.next = add nsw i64 %i, 1
26   br label %loop.header
28 ret:
29   fence seq_cst
30   ret void
33 ; CHECK: for (int c0 = 0; c0 <= n; c0 += 1)
34 ; CHECK:   Stmt_loop_body(c0)
36 ; CODEGEN: polly.start:
37 ; CODEGEN:   br label %polly.loop_if
39 ; CODEGEN: polly.loop_exit:
40 ; CODEGEN:   br label %polly.merge_new_and_old
42 ; CODEGEN: polly.loop_if:
43 ; CODEGEN:   %polly.loop_guard = icmp sle i64 0, %n
44 ; CODEGEN:   br i1 %polly.loop_guard, label %polly.loop_preheader, label %polly.loop_exit
46 ; CODEGEN: polly.loop_header:
47 ; CODEGEN:   %polly.indvar = phi i64 [ 0, %polly.loop_preheader ], [ %polly.indvar_next, %polly.stmt.loop.body ]
48 ; CODEGEN:   br label %polly.stmt.loop.body
50 ; CODEGEN: polly.stmt.loop.body:
51 ; CODEGEN:   [[PTR:%[a-zA-Z0-9_\.]+]] = getelementptr [1024 x i32], [1024 x i32]* @A, i64 0, i64 %polly.indvar
52 ; CODEGEN:   store i32 1, i32* [[PTR]]
53 ; CODEGEN:   %polly.indvar_next = add nsw i64 %polly.indvar, 1
54 ; CODEGEN:   %polly.loop_cond = icmp sle i64 %polly.indvar_next, %n
55 ; CODEGEN:   br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit
57 ; CODEGEN: polly.loop_preheader:
58 ; CODEGEN:   br label %polly.loop_header
60 ; LOOPS-DAG: Loop at depth 1 containing: %loop.header<header><exiting>,%loop.body,%loop.backedge<latch>
61 ; LOOPS-DAG: Loop at depth 1 containing: %polly.loop_header<header>,%polly.stmt.loop.body<latch><exiting>