1 ; RUN: opt %loadPolly -polly-allow-nonaffine -polly-use-llvm-names=true -polly-print-scops -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-allow-nonaffine -polly-use-llvm-names=false -polly-print-scops -disable-output < %s | FileCheck %s -check-prefix=UNNAMED
4 ; void f(int *A, int b) {
6 ; for (int i = 0; i < 1024; i++) {
20 ; CHECK-NEXT: Stmt_bb3
21 ; CHECK-NEXT: Domain :=
22 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] : 0 <= i0 <= 1023 and i0 < b };
23 ; CHECK-NEXT: Schedule :=
24 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] -> [i0, 2] };
25 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
26 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] -> MemRef_x_1__phi[] };
27 ; CHECK-NEXT: Stmt_bb7
28 ; CHECK-NEXT: Domain :=
29 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] : i0 >= b and 0 <= i0 <= 1023 and 2i0 > b };
30 ; CHECK-NEXT: Schedule :=
31 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] -> [i0, 1] };
32 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
33 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] -> MemRef_x_1__phi[] };
34 ; CHECK-NEXT: Stmt_bb8
35 ; CHECK-NEXT: Domain :=
36 ; CHECK-NEXT: [b] -> { Stmt_bb8[0] : b = 0 };
37 ; CHECK-NEXT: Schedule :=
38 ; CHECK-NEXT: [b] -> { Stmt_bb8[i0] -> [0, 0] };
39 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
40 ; CHECK-NEXT: [b] -> { Stmt_bb8[i0] -> MemRef_x_1__phi[] };
41 ; CHECK-NEXT: Stmt_bb10__TO__bb18
42 ; CHECK-NEXT: Domain :=
43 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] : 0 <= i0 <= 1023 };
44 ; CHECK-NEXT: Schedule :=
45 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> [i0, 3] }
46 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
47 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_x_1__phi[] };
48 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
49 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] };
50 ; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
51 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] };
55 ; UNNAMED-NEXT: i32 MemRef0__phi; // Element size 4
56 ; UNNAMED-NEXT: i32 MemRef1[*]; // Element size 4
59 ; UNNAMED: Statements {
61 ; UNNAMED-NEXT: Domain :=
62 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] : 0 <= i0 <= 1023 and i0 < p_0 };
63 ; UNNAMED-NEXT: Schedule :=
64 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] -> [i0, 2] };
65 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
66 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] -> MemRef0__phi[] };
68 ; UNNAMED-NEXT: Domain :=
69 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] : i0 >= p_0 and 0 <= i0 <= 1023 and 2i0 > p_0 };
70 ; UNNAMED-NEXT: Schedule :=
71 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] -> [i0, 1] };
72 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
73 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] -> MemRef0__phi[] };
75 ; UNNAMED-NEXT: Domain :=
76 ; UNNAMED-NEXT: [p_0] -> { Stmt5[0] : p_0 = 0 };
77 ; UNNAMED-NEXT: Schedule :=
78 ; UNNAMED-NEXT: [p_0] -> { Stmt5[i0] -> [0, 0] };
79 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
80 ; UNNAMED-NEXT: [p_0] -> { Stmt5[i0] -> MemRef0__phi[] };
82 ; UNNAMED-NEXT: Domain :=
83 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] : 0 <= i0 <= 1023 };
84 ; UNNAMED-NEXT: Schedule :=
85 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> [i0, 3] };
86 ; UNNAMED-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
87 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef0__phi[] };
88 ; UNNAMED-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
89 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef1[o0] };
90 ; UNNAMED-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
91 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef1[o0] };
95 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
97 define void @f(ptr %A, i32 %b) {
101 bb1: ; preds = %bb19, %bb
102 %i.0 = phi i32 [ 0, %bb ], [ %tmp20, %bb19 ]
103 %exitcond = icmp ne i32 %i.0, 1024
104 br i1 %exitcond, label %bb2, label %bb21
107 %tmp = icmp slt i32 %i.0, %b
108 br i1 %tmp, label %bb3, label %bb4
114 %tmp5 = mul nsw i32 %i.0, 2
115 %tmp6 = icmp sgt i32 %tmp5, %b
116 br i1 %tmp6, label %bb7, label %bb8
124 bb10: ; preds = %bb9, %bb3
125 %x.1 = phi i32 [ 0, %bb3 ], [ 3, %bb7 ], [ %b, %bb8 ]
126 %tmp11 = sext i32 %x.1 to i64
127 %tmp12 = getelementptr inbounds i32, ptr %A, i64 %tmp11
128 %tmp13 = load i32, ptr %tmp12, align 4
129 %tmp14 = icmp eq i32 %tmp13, 0
130 br i1 %tmp14, label %bb18, label %bb15
132 bb15: ; preds = %bb10
133 %tmp16 = sext i32 %x.1 to i64
134 %tmp17 = getelementptr inbounds i32, ptr %A, i64 %tmp16
135 store i32 0, ptr %tmp17, align 4
138 bb18: ; preds = %bb10, %bb15
141 bb19: ; preds = %bb18
142 %tmp20 = add nuw nsw i32 %i.0, 1