-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrs2-output.txt
More file actions
285 lines (285 loc) · 7.38 KB
/
arrs2-output.txt
File metadata and controls
285 lines (285 loc) · 7.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
$ java mini.MilGen arrs2.mini
Program appears to be valid!
Function arrs implemented by b2
Function size implemented by b1
Function mini_main implemented by b0
Compilation to MIL complete
Resulting program is:
--------------------------------------
not recursive
b1() =
t29 <- return 10
return t29
--------------------------------------
not recursive
b6() =
return _
--------------------------------------
recursive
b5(N, i, a) =
t2 <- mul((4, i))
t3 <- add((a, t2))
t4 <- load((t3))
_ <- print((t4))
t1 <- return 1
i <- add((i, t1))
_ <- return i
b3(a, i, N)
b3(a, i, N) =
t0 <- lt((i, N))
case t0 of
True() -> b5(N, i, a)
_ -> b6()
--------------------------------------
not recursive
b10(N, a) =
i <- return 0
_ <- return i
b3(a, i, N)
--------------------------------------
recursive
b9(N, i, a) =
t7 <- mul((4, i))
t8 <- add((a, t7))
t9 <- return 1
t10 <- sub((i, t9))
t11 <- mul((4, t10))
t12 <- add((a, t11))
t13 <- load((t12))
t14 <- return 2
t15 <- sub((i, t14))
t16 <- mul((4, t15))
t17 <- add((a, t16))
t18 <- load((t17))
t19 <- add((t13, t18))
_ <- store((t8, t19))
_ <- return t19
t6 <- return 1
i <- add((i, t6))
_ <- return i
b7(N, a, i)
b7(N, a, i) =
t5 <- lt((i, N))
case t5 of
True() -> b9(N, i, a)
_ -> b10(N, a)
--------------------------------------
not recursive
b2() =
N <- b1()
t28 <- mul((4, N))
a <- newarray((t28))
t24 <- return 0
t25 <- mul((4, t24))
t26 <- add((a, t25))
t27 <- return 0
_ <- store((t26, t27))
_ <- return t27
t20 <- return 1
t21 <- mul((4, t20))
t22 <- add((a, t21))
t23 <- return 1
_ <- store((t22, t23))
_ <- return t23
i <- return 2
b7(N, a, i)
--------------------------------------
not recursive
b0() =
_ <- b2()
return _
Running optimizer ...
-------------------------
applied right monad law in b1
inlining eliminated a wildcard binding in b5
Got down to Done (limit 3): b3(a, i, N)inlining eliminated a wildcard binding in b10
Got down to Done (limit 3): b3(a, i, N)suffixInline succeeded for call to block b3 from block b10
Immediate result of suffix inlining was:
t30 <- lt((i, N))
case t30 of
True() -> b5(N, i, a)
_ -> b6()
inlining eliminated a wildcard binding in b9
inlining eliminated a wildcard binding in b9
Got down to Done (limit 3): b7(N, a, i)inlining eliminated a wildcard binding in b2
inlining eliminated a wildcard binding in b2
prefixInline succeeded for call to block b1 from block b2
Got down to Done (limit 3): b7(N, a, i)suffixInline succeeded for call to block b7 from block b2
Immediate result of suffix inlining was:
t31 <- lt((i, N))
case t31 of
True() -> b9(N, i, a)
_ -> b10(N, a)
applied right monad law in b0
Inlining pass finished, running shake.
applied left monad law for t1 <- return 1
applied left monad law for i <- return 0
applied left monad law for t9 <- return 1
cse: using previously computed value t7 for t32
rewrite: x ! (w ! d) ==> (x ! w) ! d
cse: using previously computed value t8 for t33
applied left monad law for t14 <- return 2
cse: using previously computed value t7 for t34
rewrite: x ! (w ! d) ==> (x ! w) ! d
cse: using previously computed value t8 for t35
applied left monad law for t6 <- return 1
liveness replaced t16 with a wildcard
liveness replaced t15 with a wildcard
liveness replaced t11 with a wildcard
liveness replaced t10 with a wildcard
applied left monad law for N <- return 10
constant folding for mul
applied left monad law for t28 <- return 40
applied left monad law for t24 <- return 0
constant folding for mul
applied left monad law for t25 <- return 0
rewrite: x + 0 ==> x
applied left monad law for t26 <- return a
applied left monad law for t27 <- return 0
applied left monad law for t20 <- return 1
constant folding for mul
applied left monad law for t21 <- return 4
applied left monad law for t23 <- return 1
applied left monad law for i <- return 2
constant folding for lt
shorting out match on constructor True
Flow pass finished, running shake.
Steps performed = 42
Block b6 has no vars
reached Block buildLattice of block b3
reached Block buildLattice of block b5
reached Block buildLattice of block b10
reached Block buildLattice of block b7
reached Block buildLattice of block b9
Block b2 has no vars
Block b0 has no vars
-------------------------
Got down to Done (limit 3): b3(a, i, N)suffixInline succeeded for call to block b3 from block b5
Immediate result of suffix inlining was:
t36 <- lt((i, N))
case t36 of
True() -> b5(N, i, a)
_ -> b6()
inlining eliminated a wildcard binding in b9
inlining eliminated a wildcard binding in b9
inlining eliminated a wildcard binding in b9
inlining eliminated a wildcard binding in b9
Got down to Done (limit 3): b7(N, a, i)suffixInline succeeded for call to block b7 from block b9
Immediate result of suffix inlining was:
t37 <- lt((i, N))
case t37 of
True() -> b9(N, i, a)
_ -> b10(N, a)
Got down to Done (limit 3): b9(10, 2, a)Inlining pass finished, running shake.
lifted allocator for t31
lifted allocator for t31
lifted allocator for t31
lifted allocator for t31
liveness replaced t31 with a wildcard
Flow pass finished, running shake.
Steps performed = 11
Block b6 has no vars
reached Block buildLattice of block b5
null
Argument 1 is modified
null
Block b5 called from itself
reached Block buildLattice of block b10
reached Block buildLattice of block b9
null
Argument 1 is modified
null
Block b9 called from itself
Block b2 has no vars
Block b0 has no vars
-------------------------
inlining eliminated a wildcard binding in b2
Got down to Done (limit 3): b9(10, 2, a)Inlining pass finished, running shake.
Flow pass finished, running shake.
Steps performed = 1
Block b6 has no vars
reached Block buildLattice of block b5
null
Argument 1 is modified
null
Block b5 called from itself
reached Block buildLattice of block b10
reached Block buildLattice of block b9
null
Argument 1 is modified
null
Block b9 called from itself
Block b2 has no vars
Block b0 has no vars
-------------------------
Got down to Done (limit 3): b9(10, 2, a)Inlining pass finished, running shake.
Flow pass finished, running shake.
Steps performed = 0
Block b6 has no vars
reached Block buildLattice of block b5
null
Argument 1 is modified
null
Block b5 called from itself
reached Block buildLattice of block b10
reached Block buildLattice of block b9
null
Argument 1 is modified
null
Block b9 called from itself
Block b2 has no vars
Block b0 has no vars
Results ...
--------------------------------------
not recursive
b6() =
return _
--------------------------------------
recursive
b5(N, i, a) =
t2 <- mul((i, 4))
t3 <- add((a, t2))
t4 <- load((t3))
_ <- print((t4))
i <- add((i, 1))
t36 <- lt((i, N))
case t36 of
True() -> b5(N, i, a)
_ -> b6()
--------------------------------------
not recursive
b10(N, a) =
t30 <- lt((0, N))
case t30 of
True() -> b5(N, 0, a)
_ -> b6()
--------------------------------------
recursive
b9(N, i, a) =
t7 <- mul((i, 4))
t8 <- add((a, t7))
t12 <- add((t8, -4))
t13 <- load((t12))
t17 <- add((t8, -8))
t18 <- load((t17))
t19 <- add((t13, t18))
_ <- store((t8, t19))
i <- add((i, 1))
t37 <- lt((i, N))
case t37 of
True() -> b9(N, i, a)
_ -> b10(N, a)
--------------------------------------
not recursive
b2() =
a <- newarray((40))
_ <- store((a, 0))
t22 <- add((a, 4))
_ <- store((t22, 1))
b9(10, 2, a)
--------------------------------------
not recursive
b0() =
b2()
Done ...
Total failures found: 0