1 ; RUN: opt %loadPolly -polly-allow-nonaffine -polly-scops -analyze < %s \
2 ; RUN: -polly-use-llvm-names=true | FileCheck %s
4 ; RUN: opt %loadPolly -polly-allow-nonaffine -polly-scops -analyze < %s \
5 ; RUN: -polly-use-llvm-names=false | FileCheck %s -check-prefix=UNNAMED
7 ; void f(int *A, int b) {
9 ; for (int i = 0; i < 1024; i++) {
23 ; CHECK-NEXT: Stmt_bb3
24 ; CHECK-NEXT: Domain :=
25 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] : 0 <= i0 <= 1023 and i0 < b };
26 ; CHECK-NEXT: Schedule :=
27 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] -> [i0, 2] };
28 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
29 ; CHECK-NEXT: [b] -> { Stmt_bb3[i0] -> MemRef_x_1__phi[] };
30 ; CHECK-NEXT: Stmt_bb7
31 ; CHECK-NEXT: Domain :=
32 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] : i0 >= b and 0 <= i0 <= 1023 and 2i0 > b };
33 ; CHECK-NEXT: Schedule :=
34 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] -> [i0, 1] };
35 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
36 ; CHECK-NEXT: [b] -> { Stmt_bb7[i0] -> MemRef_x_1__phi[] };
37 ; CHECK-NEXT: Stmt_bb8
38 ; CHECK-NEXT: Domain :=
39 ; CHECK-NEXT: [b] -> { Stmt_bb8[0] : b = 0 };
40 ; CHECK-NEXT: Schedule :=
41 ; CHECK-NEXT: [b] -> { Stmt_bb8[i0] -> [0, 0] };
42 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
43 ; CHECK-NEXT: [b] -> { Stmt_bb8[i0] -> MemRef_x_1__phi[] };
44 ; CHECK-NEXT: Stmt_bb10__TO__bb18
45 ; CHECK-NEXT: Domain :=
46 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] : 0 <= i0 <= 1023 };
47 ; CHECK-NEXT: Schedule :=
48 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> [i0, 3] }
49 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
50 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_x_1__phi[] };
51 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
52 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] };
53 ; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
54 ; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] };
58 ; UNNAMED-NEXT: i32 MemRef0__phi; // Element size 4
59 ; UNNAMED-NEXT: i32 MemRef1[*]; // Element size 4
62 ; UNNAMED: Statements {
64 ; UNNAMED-NEXT: Domain :=
65 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] : 0 <= i0 <= 1023 and i0 < p_0 };
66 ; UNNAMED-NEXT: Schedule :=
67 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] -> [i0, 2] };
68 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
69 ; UNNAMED-NEXT: [p_0] -> { Stmt2[i0] -> MemRef0__phi[] };
71 ; UNNAMED-NEXT: Domain :=
72 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] : i0 >= p_0 and 0 <= i0 <= 1023 and 2i0 > p_0 };
73 ; UNNAMED-NEXT: Schedule :=
74 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] -> [i0, 1] };
75 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
76 ; UNNAMED-NEXT: [p_0] -> { Stmt4[i0] -> MemRef0__phi[] };
78 ; UNNAMED-NEXT: Domain :=
79 ; UNNAMED-NEXT: [p_0] -> { Stmt5[0] : p_0 = 0 };
80 ; UNNAMED-NEXT: Schedule :=
81 ; UNNAMED-NEXT: [p_0] -> { Stmt5[i0] -> [0, 0] };
82 ; UNNAMED-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
83 ; UNNAMED-NEXT: [p_0] -> { Stmt5[i0] -> MemRef0__phi[] };
85 ; UNNAMED-NEXT: Domain :=
86 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] : 0 <= i0 <= 1023 };
87 ; UNNAMED-NEXT: Schedule :=
88 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> [i0, 3] };
89 ; UNNAMED-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
90 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef0__phi[] };
91 ; UNNAMED-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
92 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef1[o0] };
93 ; UNNAMED-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
94 ; UNNAMED-NEXT: [p_0] -> { Stmt6[i0] -> MemRef1[o0] };
98 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
100 define void @f(i32* %A, i32 %b) {
104 bb1: ; preds = %bb19, %bb
105 %i.0 = phi i32 [ 0, %bb ], [ %tmp20, %bb19 ]
106 %exitcond = icmp ne i32 %i.0, 1024
107 br i1 %exitcond, label %bb2, label %bb21
110 %tmp = icmp slt i32 %i.0, %b
111 br i1 %tmp, label %bb3, label %bb4
117 %tmp5 = mul nsw i32 %i.0, 2
118 %tmp6 = icmp sgt i32 %tmp5, %b
119 br i1 %tmp6, label %bb7, label %bb8
127 bb10: ; preds = %bb9, %bb3
128 %x.1 = phi i32 [ 0, %bb3 ], [ 3, %bb7 ], [ %b, %bb8 ]
129 %tmp11 = sext i32 %x.1 to i64
130 %tmp12 = getelementptr inbounds i32, i32* %A, i64 %tmp11
131 %tmp13 = load i32, i32* %tmp12, align 4
132 %tmp14 = icmp eq i32 %tmp13, 0
133 br i1 %tmp14, label %bb18, label %bb15
135 bb15: ; preds = %bb10
136 %tmp16 = sext i32 %x.1 to i64
137 %tmp17 = getelementptr inbounds i32, i32* %A, i64 %tmp16
138 store i32 0, i32* %tmp17, align 4
141 bb18: ; preds = %bb10, %bb15
144 bb19: ; preds = %bb18
145 %tmp20 = add nuw nsw i32 %i.0, 1