scop.c: extract out expr_collect_access
[pet.git] / tests / conditional_assignment.scop
blob74bcd4a6b1cc8978ea146e6c04f11e13d15467c0
1 start: 218
2 end: 496
3 context: '[N, M] -> {  : N >= 0 and M >= 0 and N <= 2147483647 and M <= 2147483647
4   }'
5 arrays:
6 - context: '[M, N] -> {  : N >= 0 and M >= 0 }'
7   extent: '[N, M] -> { in1[i0, i1] : i1 <= -1 + M and i1 >= 0 and i0 <= -1 + N and
8     i0 >= 0 }'
9   element_type: int
10   element_size: 4
11 - context: '[N] -> {  : N >= 0 }'
12   extent: '[N, M] -> { in2[i0] : i0 <= -1 + N and i0 >= 0 }'
13   value_bounds: '{ [i0] : i0 >= -1 and i0 <= 1 }'
14   element_type: int
15   element_size: 4
16 - context: '[N] -> {  : N >= 0 }'
17   extent: '[N, M] -> { A[i0, i1] : i0 >= 0 and i0 <= -1 + N and i1 >= 0 and i1 <=
18     9 }'
19   element_type: int
20   element_size: 4
21 - context: '[N] -> {  : N >= 0 }'
22   extent: '[N, M] -> { C[i0] : i0 <= -1 + N and i0 >= 0 }'
23   element_type: int
24   element_size: 4
25 - context: '{  :  }'
26   extent: '[N, M] -> { m[] }'
27   element_type: int
28   element_size: 4
29 statements:
30 - line: 21
31   domain: '[N, M] -> { S_0[i] : i <= -1 + N and i >= 0 }'
32   schedule: '[N] -> { S_0[i] -> [0, i, 0] }'
33   body:
34     type: binary
35     operation: =
36     arguments:
37     - type: access
38       relation: '[N, M] -> { S_0[i] -> m[] }'
39       index: '[N, M] -> { S_0[i] -> m[] }'
40       reference: __pet_ref_0
41       read: 0
42       write: 1
43     - type: binary
44       operation: +
45       arguments:
46       - type: access
47         relation: '[N, M] -> { S_0[i] -> [i] }'
48         index: '[N, M] -> { S_0[i] -> [(i)] }'
49         reference: __pet_ref_1
50         read: 1
51         write: 0
52       - type: access
53         relation: '[N, M] -> { S_0[i] -> [1] }'
54         index: '[N, M] -> { S_0[i] -> [(1)] }'
55         reference: __pet_ref_2
56         read: 1
57         write: 0
58 - line: 23
59   domain: '[N, M] -> { S_1[i, j] : j <= -1 + M and j >= 0 and i <= -1 + N and i >=
60     0 }'
61   schedule: '[M, N] -> { S_1[i, j] -> [0, i, 1, j] }'
62   body:
63     type: binary
64     operation: =
65     arguments:
66     - type: access
67       relation: '[N, M] -> { S_1[i, j] -> m[] }'
68       index: '[N, M] -> { S_1[i, j] -> m[] }'
69       reference: __pet_ref_3
70       read: 0
71       write: 1
72     - type: call
73       name: g
74       arguments:
75       - type: call
76         name: h
77         arguments:
78         - type: access
79           relation: '[N, M] -> { S_1[i, j] -> m[] }'
80           index: '[N, M] -> { S_1[i, j] -> m[] }'
81           reference: __pet_ref_4
82           read: 1
83           write: 0
84       - type: access
85         relation: '[N, M] -> { S_1[i, j] -> in1[i, j] }'
86         index: '[N, M] -> { S_1[i, j] -> in1[(i), (j)] }'
87         reference: __pet_ref_5
88         read: 1
89         write: 0
90 - line: 24
91   domain: '[N, M] -> { S_2[i] : i <= -1 + N and i >= 0 }'
92   schedule: '[N] -> { S_2[i] -> [0, i, 2] }'
93   body:
94     type: call
95     name: compute_row
96     arguments:
97     - type: call
98       name: h
99       arguments:
100       - type: access
101         relation: '[N, M] -> { S_2[i] -> m[] }'
102         index: '[N, M] -> { S_2[i] -> m[] }'
103         reference: __pet_ref_6
104         read: 1
105         write: 0
106     - type: access
107       relation: '[N, M] -> { S_2[i] -> A[i, o1] }'
108       index: '[N, M] -> { S_2[i] -> A[(i)] }'
109       reference: __pet_ref_7
110       read: 0
111       write: 1
112 - line: 26
113   domain: '[N, M] -> { S_3[] }'
114   schedule: '{ S_3[] -> [1] }'
115   body:
116     type: binary
117     operation: =
118     arguments:
119     - type: access
120       relation: '[N, M] -> { S_3[] -> A[5, 6] }'
121       index: '[N, M] -> { S_3[] -> A[(5), (6)] }'
122       reference: __pet_ref_8
123       read: 0
124       write: 1
125     - type: access
126       relation: '[N, M] -> { S_3[] -> [0] }'
127       index: '[N, M] -> { S_3[] -> [(0)] }'
128       reference: __pet_ref_9
129       read: 1
130       write: 0
131 - line: 28
132   domain: '[N, M] -> { S_4[i] : i <= -1 + N and i >= 0 }'
133   schedule: '[N] -> { S_4[i] -> [2, i] }'
134   body:
135     type: binary
136     operation: =
137     arguments:
138     - type: access
139       relation: '[N, M] -> { S_4[i] -> C[i] }'
140       index: '[N, M] -> { S_4[i] -> C[(i)] }'
141       reference: __pet_ref_10
142       read: 0
143       write: 1
144     - type: ternary
145       arguments:
146       - type: access
147         relation: '[N, M] -> { [S_4[i] -> [i1]] -> [1] : i1 >= -i and i1 <= -1 + N
148           - i; [S_4[-1 + N] -> [1]] -> [0]; [S_4[0] -> [-1]] -> [0] }'
149         index: '[N, M] -> { [S_4[i] -> [i1]] -> [((1) : i1 >= -i and i1 <= -1 + N
150           - i; (0) : i = -1 + N and i1 = 1; (0) : i = 0 and i1 = -1)] }'
151         reference: __pet_ref_12
152         read: 1
153         write: 0
154         arguments:
155         - type: access
156           relation: '[N, M] -> { S_4[i] -> in2[i] }'
157           index: '[N, M] -> { S_4[i] -> in2[(i)] }'
158           reference: __pet_ref_11
159           read: 1
160           write: 0
161       - type: call
162         name: f
163         arguments:
164         - type: access
165           relation: '[N, M] -> { [S_4[i] -> [i1]] -> A[i + i1, o1] : i1 >= -i and
166             i1 <= -1 + N - i }'
167           index: '[N, M] -> { [S_4[i] -> [i1]] -> A[((i + i1) : i1 >= -i)] }'
168           reference: __pet_ref_14
169           read: 1
170           write: 0
171           arguments:
172           - type: access
173             relation: '[N, M] -> { S_4[i] -> in2[i] }'
174             index: '[N, M] -> { S_4[i] -> in2[(i)] }'
175             reference: __pet_ref_13
176             read: 1
177             write: 0
178       - type: access
179         relation: '[N, M] -> { [S_4[-1 + N] -> [1]] -> [0]; [S_4[0] -> [-1]] -> [0]
180           }'
181         index: '[N, M] -> { [S_4[i] -> [i1]] -> [(0)] }'
182         reference: __pet_ref_16
183         read: 1
184         write: 0
185         arguments:
186         - type: access
187           relation: '[N, M] -> { S_4[i] -> in2[i] }'
188           index: '[N, M] -> { S_4[i] -> in2[(i)] }'
189           reference: __pet_ref_15
190           read: 1
191           write: 0