]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/value-numbering/value-numbering-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / compiler / cfg / value-numbering / value-numbering-tests.factor
1 IN: compiler.cfg.value-numbering.tests
2 USING: compiler.cfg.value-numbering compiler.cfg.instructions
3 compiler.cfg.registers compiler.cfg.debugger compiler.cfg.comparisons
4 cpu.architecture tools.test kernel math combinators.short-circuit
5 accessors sequences compiler.cfg.predecessors locals
6 compiler.cfg.dce compiler.cfg.ssa.destruction
7 compiler.cfg assocs vectors arrays layouts namespaces ;
8
9 : trim-temps ( insns -- insns )
10     [
11         dup {
12             [ ##compare? ]
13             [ ##compare-imm? ]
14             [ ##compare-float? ]
15         } 1|| [ f >>temp ] when
16     ] map ;
17
18 ! Folding constants together
19 [
20     {
21         T{ ##load-reference f V int-regs 0 0.0 }
22         T{ ##load-reference f V int-regs 1 -0.0 }
23         T{ ##replace f V int-regs 0 D 0 }
24         T{ ##replace f V int-regs 1 D 1 }
25     }
26 ] [
27     {
28         T{ ##load-reference f V int-regs 0 0.0 }
29         T{ ##load-reference f V int-regs 1 -0.0 }
30         T{ ##replace f V int-regs 0 D 0 }
31         T{ ##replace f V int-regs 1 D 1 }
32     } value-numbering-step
33 ] unit-test
34
35 [
36     {
37         T{ ##load-reference f V int-regs 0 0.0 }
38         T{ ##copy f V int-regs 1 V int-regs 0 }
39         T{ ##replace f V int-regs 0 D 0 }
40         T{ ##replace f V int-regs 1 D 1 }
41     }
42 ] [
43     {
44         T{ ##load-reference f V int-regs 0 0.0 }
45         T{ ##load-reference f V int-regs 1 0.0 }
46         T{ ##replace f V int-regs 0 D 0 }
47         T{ ##replace f V int-regs 1 D 1 }
48     } value-numbering-step
49 ] unit-test
50
51 [
52     {
53         T{ ##load-reference f V int-regs 0 t }
54         T{ ##copy f V int-regs 1 V int-regs 0 }
55         T{ ##replace f V int-regs 0 D 0 }
56         T{ ##replace f V int-regs 1 D 1 }
57     }
58 ] [
59     {
60         T{ ##load-reference f V int-regs 0 t }
61         T{ ##load-reference f V int-regs 1 t }
62         T{ ##replace f V int-regs 0 D 0 }
63         T{ ##replace f V int-regs 1 D 1 }
64     } value-numbering-step
65 ] unit-test
66
67 ! Compare propagation
68 [
69     {
70         T{ ##load-reference f V int-regs 1 + }
71         T{ ##peek f V int-regs 2 D 0 }
72         T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
73         T{ ##copy f V int-regs 6 V int-regs 4 }
74         T{ ##replace f V int-regs 6 D 0 }
75     }
76 ] [
77     {
78         T{ ##load-reference f V int-regs 1 + }
79         T{ ##peek f V int-regs 2 D 0 }
80         T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
81         T{ ##compare-imm f V int-regs 6 V int-regs 4 5 cc/= }
82         T{ ##replace f V int-regs 6 D 0 }
83     } value-numbering-step trim-temps
84 ] unit-test
85
86 [
87     {
88         T{ ##load-reference f V int-regs 1 + }
89         T{ ##peek f V int-regs 2 D 0 }
90         T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
91         T{ ##compare f V int-regs 6 V int-regs 2 V int-regs 1 cc> }
92         T{ ##replace f V int-regs 6 D 0 }
93     }
94 ] [
95     {
96         T{ ##load-reference f V int-regs 1 + }
97         T{ ##peek f V int-regs 2 D 0 }
98         T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
99         T{ ##compare-imm f V int-regs 6 V int-regs 4 5 cc= }
100         T{ ##replace f V int-regs 6 D 0 }
101     } value-numbering-step trim-temps
102 ] unit-test
103
104 [
105     {
106         T{ ##peek f V int-regs 8 D 0 }
107         T{ ##peek f V int-regs 9 D -1 }
108         T{ ##unbox-float f V double-float-regs 10 V int-regs 8 }
109         T{ ##unbox-float f V double-float-regs 11 V int-regs 9 }
110         T{ ##compare-float f V int-regs 12 V double-float-regs 10 V double-float-regs 11 cc< }
111         T{ ##compare-float f V int-regs 14 V double-float-regs 10 V double-float-regs 11 cc>= }
112         T{ ##replace f V int-regs 14 D 0 }
113     }
114 ] [
115     {
116         T{ ##peek f V int-regs 8 D 0 }
117         T{ ##peek f V int-regs 9 D -1 }
118         T{ ##unbox-float f V double-float-regs 10 V int-regs 8 }
119         T{ ##unbox-float f V double-float-regs 11 V int-regs 9 }
120         T{ ##compare-float f V int-regs 12 V double-float-regs 10 V double-float-regs 11 cc< }
121         T{ ##compare-imm f V int-regs 14 V int-regs 12 5 cc= }
122         T{ ##replace f V int-regs 14 D 0 }
123     } value-numbering-step trim-temps
124 ] unit-test
125
126 [
127     {
128         T{ ##peek f V int-regs 29 D -1 }
129         T{ ##peek f V int-regs 30 D -2 }
130         T{ ##compare f V int-regs 33 V int-regs 29 V int-regs 30 cc<= }
131         T{ ##compare-branch f V int-regs 29 V int-regs 30 cc<= }
132     }
133 ] [
134     {
135         T{ ##peek f V int-regs 29 D -1 }
136         T{ ##peek f V int-regs 30 D -2 }
137         T{ ##compare f V int-regs 33 V int-regs 29 V int-regs 30 cc<= }
138         T{ ##compare-imm-branch f V int-regs 33 5 cc/= }
139     } value-numbering-step trim-temps
140 ] unit-test
141
142 ! Immediate operand conversion
143 [
144     {
145         T{ ##peek f V int-regs 0 D 0 }
146         T{ ##load-immediate f V int-regs 1 100 }
147         T{ ##add-imm f V int-regs 2 V int-regs 0 100 }
148     }
149 ] [
150     {
151         T{ ##peek f V int-regs 0 D 0 }
152         T{ ##load-immediate f V int-regs 1 100 }
153         T{ ##add f V int-regs 2 V int-regs 0 V int-regs 1 }
154     } value-numbering-step
155 ] unit-test
156
157 [
158     {
159         T{ ##peek f V int-regs 0 D 0 }
160         T{ ##load-immediate f V int-regs 1 100 }
161         T{ ##add-imm f V int-regs 2 V int-regs 0 100 }
162     }
163 ] [
164     {
165         T{ ##peek f V int-regs 0 D 0 }
166         T{ ##load-immediate f V int-regs 1 100 }
167         T{ ##add f V int-regs 2 V int-regs 1 V int-regs 0 }
168     } value-numbering-step
169 ] unit-test
170
171 [
172     {
173         T{ ##peek f V int-regs 0 D 0 }
174         T{ ##load-immediate f V int-regs 1 100 }
175         T{ ##add-imm f V int-regs 2 V int-regs 0 -100 }
176     }
177 ] [
178     {
179         T{ ##peek f V int-regs 0 D 0 }
180         T{ ##load-immediate f V int-regs 1 100 }
181         T{ ##sub f V int-regs 2 V int-regs 0 V int-regs 1 }
182     } value-numbering-step
183 ] unit-test
184
185 [
186     {
187         T{ ##peek f V int-regs 0 D 0 }
188         T{ ##load-immediate f V int-regs 1 0 }
189     }
190 ] [
191     {
192         T{ ##peek f V int-regs 0 D 0 }
193         T{ ##sub f V int-regs 1 V int-regs 0 V int-regs 0 }
194     } value-numbering-step
195 ] unit-test
196
197 [
198     {
199         T{ ##peek f V int-regs 0 D 0 }
200         T{ ##load-immediate f V int-regs 1 100 }
201         T{ ##mul-imm f V int-regs 2 V int-regs 0 100 }
202     }
203 ] [
204     {
205         T{ ##peek f V int-regs 0 D 0 }
206         T{ ##load-immediate f V int-regs 1 100 }
207         T{ ##mul f V int-regs 2 V int-regs 0 V int-regs 1 }
208     } value-numbering-step
209 ] unit-test
210
211 [
212     {
213         T{ ##peek f V int-regs 0 D 0 }
214         T{ ##load-immediate f V int-regs 1 100 }
215         T{ ##mul-imm f V int-regs 2 V int-regs 0 100 }
216     }
217 ] [
218     {
219         T{ ##peek f V int-regs 0 D 0 }
220         T{ ##load-immediate f V int-regs 1 100 }
221         T{ ##mul f V int-regs 2 V int-regs 1 V int-regs 0 }
222     } value-numbering-step
223 ] unit-test
224
225 [
226     {
227         T{ ##peek f V int-regs 1 D 0 }
228         T{ ##shl-imm f V int-regs 2 V int-regs 1 3 }
229     }
230 ] [
231     {
232         T{ ##peek f V int-regs 1 D 0 }
233         T{ ##mul-imm f V int-regs 2 V int-regs 1 8 }
234     } value-numbering-step
235 ] unit-test
236
237 [
238     {
239         T{ ##peek f V int-regs 0 D 0 }
240         T{ ##load-immediate f V int-regs 1 100 }
241         T{ ##and-imm f V int-regs 2 V int-regs 0 100 }
242     }
243 ] [
244     {
245         T{ ##peek f V int-regs 0 D 0 }
246         T{ ##load-immediate f V int-regs 1 100 }
247         T{ ##and f V int-regs 2 V int-regs 0 V int-regs 1 }
248     } value-numbering-step
249 ] unit-test
250
251 [
252     {
253         T{ ##peek f V int-regs 0 D 0 }
254         T{ ##load-immediate f V int-regs 1 100 }
255         T{ ##and-imm f V int-regs 2 V int-regs 0 100 }
256     }
257 ] [
258     {
259         T{ ##peek f V int-regs 0 D 0 }
260         T{ ##load-immediate f V int-regs 1 100 }
261         T{ ##and f V int-regs 2 V int-regs 1 V int-regs 0 }
262     } value-numbering-step
263 ] unit-test
264
265 [
266     {
267         T{ ##peek f V int-regs 0 D 0 }
268         T{ ##load-immediate f V int-regs 1 100 }
269         T{ ##or-imm f V int-regs 2 V int-regs 0 100 }
270     }
271 ] [
272     {
273         T{ ##peek f V int-regs 0 D 0 }
274         T{ ##load-immediate f V int-regs 1 100 }
275         T{ ##or f V int-regs 2 V int-regs 0 V int-regs 1 }
276     } value-numbering-step
277 ] unit-test
278
279 [
280     {
281         T{ ##peek f V int-regs 0 D 0 }
282         T{ ##load-immediate f V int-regs 1 100 }
283         T{ ##or-imm f V int-regs 2 V int-regs 0 100 }
284     }
285 ] [
286     {
287         T{ ##peek f V int-regs 0 D 0 }
288         T{ ##load-immediate f V int-regs 1 100 }
289         T{ ##or f V int-regs 2 V int-regs 1 V int-regs 0 }
290     } value-numbering-step
291 ] unit-test
292
293 [
294     {
295         T{ ##peek f V int-regs 0 D 0 }
296         T{ ##load-immediate f V int-regs 1 100 }
297         T{ ##xor-imm f V int-regs 2 V int-regs 0 100 }
298     }
299 ] [
300     {
301         T{ ##peek f V int-regs 0 D 0 }
302         T{ ##load-immediate f V int-regs 1 100 }
303         T{ ##xor f V int-regs 2 V int-regs 0 V int-regs 1 }
304     } value-numbering-step
305 ] unit-test
306
307 [
308     {
309         T{ ##peek f V int-regs 0 D 0 }
310         T{ ##load-immediate f V int-regs 1 100 }
311         T{ ##xor-imm f V int-regs 2 V int-regs 0 100 }
312     }
313 ] [
314     {
315         T{ ##peek f V int-regs 0 D 0 }
316         T{ ##load-immediate f V int-regs 1 100 }
317         T{ ##xor f V int-regs 2 V int-regs 1 V int-regs 0 }
318     } value-numbering-step
319 ] unit-test
320
321 [
322     {
323         T{ ##peek f V int-regs 0 D 0 }
324         T{ ##load-immediate f V int-regs 1 100 }
325         T{ ##compare-imm f V int-regs 2 V int-regs 0 100 cc<= }
326     }
327 ] [
328     {
329         T{ ##peek f V int-regs 0 D 0 }
330         T{ ##load-immediate f V int-regs 1 100 }
331         T{ ##compare f V int-regs 2 V int-regs 0 V int-regs 1 cc<= }
332     } value-numbering-step trim-temps
333 ] unit-test
334
335 [
336     {
337         T{ ##peek f V int-regs 0 D 0 }
338         T{ ##load-immediate f V int-regs 1 100 }
339         T{ ##compare-imm f V int-regs 2 V int-regs 0 100 cc>= }
340     }
341 ] [
342     {
343         T{ ##peek f V int-regs 0 D 0 }
344         T{ ##load-immediate f V int-regs 1 100 }
345         T{ ##compare f V int-regs 2 V int-regs 1 V int-regs 0 cc<= }
346     } value-numbering-step trim-temps
347 ] unit-test
348
349 [
350     {
351         T{ ##peek f V int-regs 0 D 0 }
352         T{ ##load-immediate f V int-regs 1 100 }
353         T{ ##compare-imm-branch f V int-regs 0 100 cc<= }
354     }
355 ] [
356     {
357         T{ ##peek f V int-regs 0 D 0 }
358         T{ ##load-immediate f V int-regs 1 100 }
359         T{ ##compare-branch f V int-regs 0 V int-regs 1 cc<= }
360     } value-numbering-step
361 ] unit-test
362
363 [
364     {
365         T{ ##peek f V int-regs 0 D 0 }
366         T{ ##load-immediate f V int-regs 1 100 }
367         T{ ##compare-imm-branch f V int-regs 0 100 cc>= }
368     }
369 ] [
370     {
371         T{ ##peek f V int-regs 0 D 0 }
372         T{ ##load-immediate f V int-regs 1 100 }
373         T{ ##compare-branch f V int-regs 1 V int-regs 0 cc<= }
374     } value-numbering-step trim-temps
375 ] unit-test
376
377 ! Reassociation
378 [
379     {
380         T{ ##peek f V int-regs 0 D 0 }
381         T{ ##load-immediate f V int-regs 1 100 }
382         T{ ##add-imm f V int-regs 2 V int-regs 0 100 }
383         T{ ##load-immediate f V int-regs 3 50 }
384         T{ ##add-imm f V int-regs 4 V int-regs 0 150 }
385     }
386 ] [
387     {
388         T{ ##peek f V int-regs 0 D 0 }
389         T{ ##load-immediate f V int-regs 1 100 }
390         T{ ##add f V int-regs 2 V int-regs 0 V int-regs 1 }
391         T{ ##load-immediate f V int-regs 3 50 }
392         T{ ##add f V int-regs 4 V int-regs 2 V int-regs 3 }
393     } value-numbering-step
394 ] unit-test
395
396 [
397     {
398         T{ ##peek f V int-regs 0 D 0 }
399         T{ ##load-immediate f V int-regs 1 100 }
400         T{ ##add-imm f V int-regs 2 V int-regs 0 100 }
401         T{ ##load-immediate f V int-regs 3 50 }
402         T{ ##add-imm f V int-regs 4 V int-regs 0 150 }
403     }
404 ] [
405     {
406         T{ ##peek f V int-regs 0 D 0 }
407         T{ ##load-immediate f V int-regs 1 100 }
408         T{ ##add f V int-regs 2 V int-regs 1 V int-regs 0 }
409         T{ ##load-immediate f V int-regs 3 50 }
410         T{ ##add f V int-regs 4 V int-regs 3 V int-regs 2 }
411     } value-numbering-step
412 ] unit-test
413
414 [
415     {
416         T{ ##peek f V int-regs 0 D 0 }
417         T{ ##load-immediate f V int-regs 1 100 }
418         T{ ##add-imm f V int-regs 2 V int-regs 0 100 }
419         T{ ##load-immediate f V int-regs 3 50 }
420         T{ ##add-imm f V int-regs 4 V int-regs 0 50 }
421     }
422 ] [
423     {
424         T{ ##peek f V int-regs 0 D 0 }
425         T{ ##load-immediate f V int-regs 1 100 }
426         T{ ##add f V int-regs 2 V int-regs 0 V int-regs 1 }
427         T{ ##load-immediate f V int-regs 3 50 }
428         T{ ##sub f V int-regs 4 V int-regs 2 V int-regs 3 }
429     } value-numbering-step
430 ] unit-test
431
432 [
433     {
434         T{ ##peek f V int-regs 0 D 0 }
435         T{ ##load-immediate f V int-regs 1 100 }
436         T{ ##add-imm f V int-regs 2 V int-regs 0 -100 }
437         T{ ##load-immediate f V int-regs 3 50 }
438         T{ ##add-imm f V int-regs 4 V int-regs 0 -150 }
439     }
440 ] [
441     {
442         T{ ##peek f V int-regs 0 D 0 }
443         T{ ##load-immediate f V int-regs 1 100 }
444         T{ ##sub f V int-regs 2 V int-regs 0 V int-regs 1 }
445         T{ ##load-immediate f V int-regs 3 50 }
446         T{ ##sub f V int-regs 4 V int-regs 2 V int-regs 3 }
447     } value-numbering-step
448 ] unit-test
449
450 [
451     {
452         T{ ##peek f V int-regs 0 D 0 }
453         T{ ##load-immediate f V int-regs 1 100 }
454         T{ ##mul-imm f V int-regs 2 V int-regs 0 100 }
455         T{ ##load-immediate f V int-regs 3 50 }
456         T{ ##mul-imm f V int-regs 4 V int-regs 0 5000 }
457     }
458 ] [
459     {
460         T{ ##peek f V int-regs 0 D 0 }
461         T{ ##load-immediate f V int-regs 1 100 }
462         T{ ##mul f V int-regs 2 V int-regs 0 V int-regs 1 }
463         T{ ##load-immediate f V int-regs 3 50 }
464         T{ ##mul f V int-regs 4 V int-regs 2 V int-regs 3 }
465     } value-numbering-step
466 ] unit-test
467
468 [
469     {
470         T{ ##peek f V int-regs 0 D 0 }
471         T{ ##load-immediate f V int-regs 1 100 }
472         T{ ##mul-imm f V int-regs 2 V int-regs 0 100 }
473         T{ ##load-immediate f V int-regs 3 50 }
474         T{ ##mul-imm f V int-regs 4 V int-regs 0 5000 }
475     }
476 ] [
477     {
478         T{ ##peek f V int-regs 0 D 0 }
479         T{ ##load-immediate f V int-regs 1 100 }
480         T{ ##mul f V int-regs 2 V int-regs 1 V int-regs 0 }
481         T{ ##load-immediate f V int-regs 3 50 }
482         T{ ##mul f V int-regs 4 V int-regs 3 V int-regs 2 }
483     } value-numbering-step
484 ] unit-test
485
486 [
487     {
488         T{ ##peek f V int-regs 0 D 0 }
489         T{ ##load-immediate f V int-regs 1 100 }
490         T{ ##and-imm f V int-regs 2 V int-regs 0 100 }
491         T{ ##load-immediate f V int-regs 3 50 }
492         T{ ##and-imm f V int-regs 4 V int-regs 0 32 }
493     }
494 ] [
495     {
496         T{ ##peek f V int-regs 0 D 0 }
497         T{ ##load-immediate f V int-regs 1 100 }
498         T{ ##and f V int-regs 2 V int-regs 0 V int-regs 1 }
499         T{ ##load-immediate f V int-regs 3 50 }
500         T{ ##and f V int-regs 4 V int-regs 2 V int-regs 3 }
501     } value-numbering-step
502 ] unit-test
503
504 [
505     {
506         T{ ##peek f V int-regs 0 D 0 }
507         T{ ##load-immediate f V int-regs 1 100 }
508         T{ ##and-imm f V int-regs 2 V int-regs 0 100 }
509         T{ ##load-immediate f V int-regs 3 50 }
510         T{ ##and-imm f V int-regs 4 V int-regs 0 32 }
511     }
512 ] [
513     {
514         T{ ##peek f V int-regs 0 D 0 }
515         T{ ##load-immediate f V int-regs 1 100 }
516         T{ ##and f V int-regs 2 V int-regs 1 V int-regs 0 }
517         T{ ##load-immediate f V int-regs 3 50 }
518         T{ ##and f V int-regs 4 V int-regs 3 V int-regs 2 }
519     } value-numbering-step
520 ] unit-test
521
522 [
523     {
524         T{ ##peek f V int-regs 0 D 0 }
525         T{ ##load-immediate f V int-regs 1 100 }
526         T{ ##or-imm f V int-regs 2 V int-regs 0 100 }
527         T{ ##load-immediate f V int-regs 3 50 }
528         T{ ##or-imm f V int-regs 4 V int-regs 0 118 }
529     }
530 ] [
531     {
532         T{ ##peek f V int-regs 0 D 0 }
533         T{ ##load-immediate f V int-regs 1 100 }
534         T{ ##or f V int-regs 2 V int-regs 0 V int-regs 1 }
535         T{ ##load-immediate f V int-regs 3 50 }
536         T{ ##or f V int-regs 4 V int-regs 2 V int-regs 3 }
537     } value-numbering-step
538 ] unit-test
539
540 [
541     {
542         T{ ##peek f V int-regs 0 D 0 }
543         T{ ##load-immediate f V int-regs 1 100 }
544         T{ ##or-imm f V int-regs 2 V int-regs 0 100 }
545         T{ ##load-immediate f V int-regs 3 50 }
546         T{ ##or-imm f V int-regs 4 V int-regs 0 118 }
547     }
548 ] [
549     {
550         T{ ##peek f V int-regs 0 D 0 }
551         T{ ##load-immediate f V int-regs 1 100 }
552         T{ ##or f V int-regs 2 V int-regs 1 V int-regs 0 }
553         T{ ##load-immediate f V int-regs 3 50 }
554         T{ ##or f V int-regs 4 V int-regs 3 V int-regs 2 }
555     } value-numbering-step
556 ] unit-test
557
558 [
559     {
560         T{ ##peek f V int-regs 0 D 0 }
561         T{ ##load-immediate f V int-regs 1 100 }
562         T{ ##xor-imm f V int-regs 2 V int-regs 0 100 }
563         T{ ##load-immediate f V int-regs 3 50 }
564         T{ ##xor-imm f V int-regs 4 V int-regs 0 86 }
565     }
566 ] [
567     {
568         T{ ##peek f V int-regs 0 D 0 }
569         T{ ##load-immediate f V int-regs 1 100 }
570         T{ ##xor f V int-regs 2 V int-regs 0 V int-regs 1 }
571         T{ ##load-immediate f V int-regs 3 50 }
572         T{ ##xor f V int-regs 4 V int-regs 2 V int-regs 3 }
573     } value-numbering-step
574 ] unit-test
575
576 [
577     {
578         T{ ##peek f V int-regs 0 D 0 }
579         T{ ##load-immediate f V int-regs 1 100 }
580         T{ ##xor-imm f V int-regs 2 V int-regs 0 100 }
581         T{ ##load-immediate f V int-regs 3 50 }
582         T{ ##xor-imm f V int-regs 4 V int-regs 0 86 }
583     }
584 ] [
585     {
586         T{ ##peek f V int-regs 0 D 0 }
587         T{ ##load-immediate f V int-regs 1 100 }
588         T{ ##xor f V int-regs 2 V int-regs 1 V int-regs 0 }
589         T{ ##load-immediate f V int-regs 3 50 }
590         T{ ##xor f V int-regs 4 V int-regs 3 V int-regs 2 }
591     } value-numbering-step
592 ] unit-test
593
594 ! Simplification
595 [
596     {
597         T{ ##peek f V int-regs 0 D 0 }
598         T{ ##peek f V int-regs 1 D 1 }
599         T{ ##load-immediate f V int-regs 2 0 }
600         T{ ##copy f V int-regs 3 V int-regs 0 }
601         T{ ##replace f V int-regs 3 D 0 }
602     }
603 ] [
604     {
605         T{ ##peek f V int-regs 0 D 0 }
606         T{ ##peek f V int-regs 1 D 1 }
607         T{ ##sub f V int-regs 2 V int-regs 1 V int-regs 1 }
608         T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
609         T{ ##replace f V int-regs 3 D 0 }
610     } value-numbering-step
611 ] unit-test
612
613 [
614     {
615         T{ ##peek f V int-regs 0 D 0 }
616         T{ ##peek f V int-regs 1 D 1 }
617         T{ ##load-immediate f V int-regs 2 0 }
618         T{ ##copy f V int-regs 3 V int-regs 0 }
619         T{ ##replace f V int-regs 3 D 0 }
620     }
621 ] [
622     {
623         T{ ##peek f V int-regs 0 D 0 }
624         T{ ##peek f V int-regs 1 D 1 }
625         T{ ##sub f V int-regs 2 V int-regs 1 V int-regs 1 }
626         T{ ##sub f V int-regs 3 V int-regs 0 V int-regs 2 }
627         T{ ##replace f V int-regs 3 D 0 }
628     } value-numbering-step
629 ] unit-test
630
631 [
632     {
633         T{ ##peek f V int-regs 0 D 0 }
634         T{ ##peek f V int-regs 1 D 1 }
635         T{ ##load-immediate f V int-regs 2 0 }
636         T{ ##copy f V int-regs 3 V int-regs 0 }
637         T{ ##replace f V int-regs 3 D 0 }
638     }
639 ] [
640     {
641         T{ ##peek f V int-regs 0 D 0 }
642         T{ ##peek f V int-regs 1 D 1 }
643         T{ ##sub f V int-regs 2 V int-regs 1 V int-regs 1 }
644         T{ ##or f V int-regs 3 V int-regs 0 V int-regs 2 }
645         T{ ##replace f V int-regs 3 D 0 }
646     } value-numbering-step
647 ] unit-test
648
649 [
650     {
651         T{ ##peek f V int-regs 0 D 0 }
652         T{ ##peek f V int-regs 1 D 1 }
653         T{ ##load-immediate f V int-regs 2 0 }
654         T{ ##copy f V int-regs 3 V int-regs 0 }
655         T{ ##replace f V int-regs 3 D 0 }
656     }
657 ] [
658     {
659         T{ ##peek f V int-regs 0 D 0 }
660         T{ ##peek f V int-regs 1 D 1 }
661         T{ ##sub f V int-regs 2 V int-regs 1 V int-regs 1 }
662         T{ ##xor f V int-regs 3 V int-regs 0 V int-regs 2 }
663         T{ ##replace f V int-regs 3 D 0 }
664     } value-numbering-step
665 ] unit-test
666
667 [
668     {
669         T{ ##peek f V int-regs 0 D 0 }
670         T{ ##load-immediate f V int-regs 1 1 }
671         T{ ##copy f V int-regs 2 V int-regs 0 }
672         T{ ##replace f V int-regs 2 D 0 }
673     }
674 ] [
675     {
676         T{ ##peek f V int-regs 0 D 0 }
677         T{ ##load-immediate f V int-regs 1 1 }
678         T{ ##mul f V int-regs 2 V int-regs 0 V int-regs 1 }
679         T{ ##replace f V int-regs 2 D 0 }
680     } value-numbering-step
681 ] unit-test
682
683 ! Constant folding
684 [
685     {
686         T{ ##peek f V int-regs 0 D 0 }
687         T{ ##load-immediate f V int-regs 1 1 }
688         T{ ##load-immediate f V int-regs 2 3 }
689         T{ ##load-immediate f V int-regs 3 4 }
690     }
691 ] [
692     {
693         T{ ##peek f V int-regs 0 D 0 }
694         T{ ##load-immediate f V int-regs 1 1 }
695         T{ ##load-immediate f V int-regs 2 3 }
696         T{ ##add f V int-regs 3 V int-regs 1 V int-regs 2 }
697     } value-numbering-step
698 ] unit-test
699
700 [
701     {
702         T{ ##peek f V int-regs 0 D 0 }
703         T{ ##load-immediate f V int-regs 1 1 }
704         T{ ##load-immediate f V int-regs 2 3 }
705         T{ ##load-immediate f V int-regs 3 -2 }
706     }
707 ] [
708     {
709         T{ ##peek f V int-regs 0 D 0 }
710         T{ ##load-immediate f V int-regs 1 1 }
711         T{ ##load-immediate f V int-regs 2 3 }
712         T{ ##sub f V int-regs 3 V int-regs 1 V int-regs 2 }
713     } value-numbering-step
714 ] unit-test
715
716 [
717     {
718         T{ ##peek f V int-regs 0 D 0 }
719         T{ ##load-immediate f V int-regs 1 2 }
720         T{ ##load-immediate f V int-regs 2 3 }
721         T{ ##load-immediate f V int-regs 3 6 }
722     }
723 ] [
724     {
725         T{ ##peek f V int-regs 0 D 0 }
726         T{ ##load-immediate f V int-regs 1 2 }
727         T{ ##load-immediate f V int-regs 2 3 }
728         T{ ##mul f V int-regs 3 V int-regs 1 V int-regs 2 }
729     } value-numbering-step
730 ] unit-test
731
732 [
733     {
734         T{ ##peek f V int-regs 0 D 0 }
735         T{ ##load-immediate f V int-regs 1 2 }
736         T{ ##load-immediate f V int-regs 2 1 }
737         T{ ##load-immediate f V int-regs 3 0 }
738     }
739 ] [
740     {
741         T{ ##peek f V int-regs 0 D 0 }
742         T{ ##load-immediate f V int-regs 1 2 }
743         T{ ##load-immediate f V int-regs 2 1 }
744         T{ ##and f V int-regs 3 V int-regs 1 V int-regs 2 }
745     } value-numbering-step
746 ] unit-test
747
748 [
749     {
750         T{ ##peek f V int-regs 0 D 0 }
751         T{ ##load-immediate f V int-regs 1 2 }
752         T{ ##load-immediate f V int-regs 2 1 }
753         T{ ##load-immediate f V int-regs 3 3 }
754     }
755 ] [
756     {
757         T{ ##peek f V int-regs 0 D 0 }
758         T{ ##load-immediate f V int-regs 1 2 }
759         T{ ##load-immediate f V int-regs 2 1 }
760         T{ ##or f V int-regs 3 V int-regs 1 V int-regs 2 }
761     } value-numbering-step
762 ] unit-test
763
764 [
765     {
766         T{ ##peek f V int-regs 0 D 0 }
767         T{ ##load-immediate f V int-regs 1 2 }
768         T{ ##load-immediate f V int-regs 2 3 }
769         T{ ##load-immediate f V int-regs 3 1 }
770     }
771 ] [
772     {
773         T{ ##peek f V int-regs 0 D 0 }
774         T{ ##load-immediate f V int-regs 1 2 }
775         T{ ##load-immediate f V int-regs 2 3 }
776         T{ ##xor f V int-regs 3 V int-regs 1 V int-regs 2 }
777     } value-numbering-step
778 ] unit-test
779
780 [
781     {
782         T{ ##peek f V int-regs 0 D 0 }
783         T{ ##load-immediate f V int-regs 1 1 }
784         T{ ##load-immediate f V int-regs 3 8 }
785     }
786 ] [
787     {
788         T{ ##peek f V int-regs 0 D 0 }
789         T{ ##load-immediate f V int-regs 1 1 }
790         T{ ##shl-imm f V int-regs 3 V int-regs 1 3 }
791     } value-numbering-step
792 ] unit-test
793
794 cell 8 = [
795     [
796         {
797             T{ ##peek f V int-regs 0 D 0 }
798             T{ ##load-immediate f V int-regs 1 -1 }
799             T{ ##load-immediate f V int-regs 3 HEX: ffffffffffff }
800         }
801     ] [
802         {
803             T{ ##peek f V int-regs 0 D 0 }
804             T{ ##load-immediate f V int-regs 1 -1 }
805             T{ ##shr-imm f V int-regs 3 V int-regs 1 16 }
806         } value-numbering-step
807     ] unit-test
808 ] when
809
810 [
811     {
812         T{ ##peek f V int-regs 0 D 0 }
813         T{ ##load-immediate f V int-regs 1 -8 }
814         T{ ##load-immediate f V int-regs 3 -4 }
815     }
816 ] [
817     {
818         T{ ##peek f V int-regs 0 D 0 }
819         T{ ##load-immediate f V int-regs 1 -8 }
820         T{ ##sar-imm f V int-regs 3 V int-regs 1 1 }
821     } value-numbering-step
822 ] unit-test
823
824 cell 8 = [
825     [
826         {
827             T{ ##peek f V int-regs 0 D 0 }
828             T{ ##load-immediate f V int-regs 1 65536 }
829             T{ ##load-immediate f V int-regs 2 140737488355328 }
830             T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
831         }
832     ] [
833         {
834             T{ ##peek f V int-regs 0 D 0 }
835             T{ ##load-immediate f V int-regs 1 65536 }
836             T{ ##shl-imm f V int-regs 2 V int-regs 1 31 }
837             T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
838         } value-numbering-step
839     ] unit-test
840
841     [
842         {
843             T{ ##peek f V int-regs 0 D 0 }
844             T{ ##load-immediate f V int-regs 2 140737488355328 }
845             T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
846         }
847     ] [
848         {
849             T{ ##peek f V int-regs 0 D 0 }
850             T{ ##load-immediate f V int-regs 2 140737488355328 }
851             T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
852         } value-numbering-step
853     ] unit-test
854
855     [
856         {
857             T{ ##peek f V int-regs 0 D 0 }
858             T{ ##load-immediate f V int-regs 2 2147483647 }
859             T{ ##add-imm f V int-regs 3 V int-regs 0 2147483647 }
860             T{ ##add-imm f V int-regs 4 V int-regs 3 2147483647 }
861         }
862     ] [
863         {
864             T{ ##peek f V int-regs 0 D 0 }
865             T{ ##load-immediate f V int-regs 2 2147483647 }
866             T{ ##add f V int-regs 3 V int-regs 0 V int-regs 2 }
867             T{ ##add f V int-regs 4 V int-regs 3 V int-regs 2 }
868         } value-numbering-step
869     ] unit-test
870 ] when
871
872 ! Branch folding
873 [
874     {
875         T{ ##load-immediate f V int-regs 1 1 }
876         T{ ##load-immediate f V int-regs 2 2 }
877         T{ ##load-immediate f V int-regs 3 5 }
878     }
879 ] [
880     {
881         T{ ##load-immediate f V int-regs 1 1 }
882         T{ ##load-immediate f V int-regs 2 2 }
883         T{ ##compare f V int-regs 3 V int-regs 1 V int-regs 2 cc= }
884     } value-numbering-step
885 ] unit-test
886
887 [
888     {
889         T{ ##load-immediate f V int-regs 1 1 }
890         T{ ##load-immediate f V int-regs 2 2 }
891         T{ ##load-reference f V int-regs 3 t }
892     }
893 ] [
894     {
895         T{ ##load-immediate f V int-regs 1 1 }
896         T{ ##load-immediate f V int-regs 2 2 }
897         T{ ##compare f V int-regs 3 V int-regs 1 V int-regs 2 cc/= }
898     } value-numbering-step
899 ] unit-test
900
901 [
902     {
903         T{ ##load-immediate f V int-regs 1 1 }
904         T{ ##load-immediate f V int-regs 2 2 }
905         T{ ##load-reference f V int-regs 3 t }
906     }
907 ] [
908     {
909         T{ ##load-immediate f V int-regs 1 1 }
910         T{ ##load-immediate f V int-regs 2 2 }
911         T{ ##compare f V int-regs 3 V int-regs 1 V int-regs 2 cc< }
912     } value-numbering-step
913 ] unit-test
914
915 [
916     {
917         T{ ##load-immediate f V int-regs 1 1 }
918         T{ ##load-immediate f V int-regs 2 2 }
919         T{ ##load-immediate f V int-regs 3 5 }
920     }
921 ] [
922     {
923         T{ ##load-immediate f V int-regs 1 1 }
924         T{ ##load-immediate f V int-regs 2 2 }
925         T{ ##compare f V int-regs 3 V int-regs 2 V int-regs 1 cc< }
926     } value-numbering-step
927 ] unit-test
928
929 [
930     {
931         T{ ##peek f V int-regs 0 D 0 }
932         T{ ##load-immediate f V int-regs 1 5 }
933     }
934 ] [
935     {
936         T{ ##peek f V int-regs 0 D 0 }
937         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc< }
938     } value-numbering-step
939 ] unit-test
940
941 [
942     {
943         T{ ##peek f V int-regs 0 D 0 }
944         T{ ##load-reference f V int-regs 1 t }
945     }
946 ] [
947     {
948         T{ ##peek f V int-regs 0 D 0 }
949         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc<= }
950     } value-numbering-step
951 ] unit-test
952
953 [
954     {
955         T{ ##peek f V int-regs 0 D 0 }
956         T{ ##load-immediate f V int-regs 1 5 }
957     }
958 ] [
959     {
960         T{ ##peek f V int-regs 0 D 0 }
961         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc> }
962     } value-numbering-step
963 ] unit-test
964
965 [
966     {
967         T{ ##peek f V int-regs 0 D 0 }
968         T{ ##load-reference f V int-regs 1 t }
969     }
970 ] [
971     {
972         T{ ##peek f V int-regs 0 D 0 }
973         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc>= }
974     } value-numbering-step
975 ] unit-test
976
977 [
978     {
979         T{ ##peek f V int-regs 0 D 0 }
980         T{ ##load-immediate f V int-regs 1 5 }
981     }
982 ] [
983     {
984         T{ ##peek f V int-regs 0 D 0 }
985         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc/= }
986     } value-numbering-step
987 ] unit-test
988
989 [
990     {
991         T{ ##peek f V int-regs 0 D 0 }
992         T{ ##load-reference f V int-regs 1 t }
993     }
994 ] [
995     {
996         T{ ##peek f V int-regs 0 D 0 }
997         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc= }
998     } value-numbering-step
999 ] unit-test
1000
1001 : test-branch-folding ( insns -- insns' n )
1002     <basic-block>
1003     [ V{ 0 1 } clone >>successors basic-block set value-numbering-step ] keep
1004     successors>> first ;
1005
1006 [
1007     {
1008         T{ ##load-immediate f V int-regs 1 1 }
1009         T{ ##load-immediate f V int-regs 2 2 }
1010         T{ ##branch }
1011     }
1012     1
1013 ] [
1014     {
1015         T{ ##load-immediate f V int-regs 1 1 }
1016         T{ ##load-immediate f V int-regs 2 2 }
1017         T{ ##compare-branch f V int-regs 1 V int-regs 2 cc= }
1018     } test-branch-folding
1019 ] unit-test
1020
1021 [
1022     {
1023         T{ ##load-immediate f V int-regs 1 1 }
1024         T{ ##load-immediate f V int-regs 2 2 }
1025         T{ ##branch }
1026     }
1027     0
1028 ] [
1029     {
1030         T{ ##load-immediate f V int-regs 1 1 }
1031         T{ ##load-immediate f V int-regs 2 2 }
1032         T{ ##compare-branch f V int-regs 1 V int-regs 2 cc/= }
1033     } test-branch-folding
1034 ] unit-test
1035
1036 [
1037     {
1038         T{ ##load-immediate f V int-regs 1 1 }
1039         T{ ##load-immediate f V int-regs 2 2 }
1040         T{ ##branch }
1041     }
1042     0
1043 ] [
1044     {
1045         T{ ##load-immediate f V int-regs 1 1 }
1046         T{ ##load-immediate f V int-regs 2 2 }
1047         T{ ##compare-branch f V int-regs 1 V int-regs 2 cc< }
1048     } test-branch-folding
1049 ] unit-test
1050
1051 [
1052     {
1053         T{ ##load-immediate f V int-regs 1 1 }
1054         T{ ##load-immediate f V int-regs 2 2 }
1055         T{ ##branch }
1056     }
1057     1
1058 ] [
1059     {
1060         T{ ##load-immediate f V int-regs 1 1 }
1061         T{ ##load-immediate f V int-regs 2 2 }
1062         T{ ##compare-branch f V int-regs 2 V int-regs 1 cc< }
1063     } test-branch-folding
1064 ] unit-test
1065
1066 [
1067     {
1068         T{ ##peek f V int-regs 0 D 0 }
1069         T{ ##branch }
1070     }
1071     1
1072 ] [
1073     {
1074         T{ ##peek f V int-regs 0 D 0 }
1075         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc< }
1076     } test-branch-folding
1077 ] unit-test
1078
1079 [
1080     {
1081         T{ ##peek f V int-regs 0 D 0 }
1082         T{ ##branch }
1083     }
1084     0
1085 ] [
1086     {
1087         T{ ##peek f V int-regs 0 D 0 }
1088         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc<= }
1089     } test-branch-folding
1090 ] unit-test
1091
1092 [
1093     {
1094         T{ ##peek f V int-regs 0 D 0 }
1095         T{ ##branch }
1096     }
1097     1
1098 ] [
1099     {
1100         T{ ##peek f V int-regs 0 D 0 }
1101         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc> }
1102     } test-branch-folding
1103 ] unit-test
1104
1105 [
1106     {
1107         T{ ##peek f V int-regs 0 D 0 }
1108         T{ ##branch }
1109     }
1110     0
1111 ] [
1112     {
1113         T{ ##peek f V int-regs 0 D 0 }
1114         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc>= }
1115     } test-branch-folding
1116 ] unit-test
1117
1118 [
1119     {
1120         T{ ##peek f V int-regs 0 D 0 }
1121         T{ ##branch }
1122     }
1123     0
1124 ] [
1125     {
1126         T{ ##peek f V int-regs 0 D 0 }
1127         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc= }
1128     } test-branch-folding
1129 ] unit-test
1130
1131 [
1132     {
1133         T{ ##peek f V int-regs 0 D 0 }
1134         T{ ##branch }
1135     }
1136     1
1137 ] [
1138     {
1139         T{ ##peek f V int-regs 0 D 0 }
1140         T{ ##compare-branch f V int-regs 0 V int-regs 0 cc/= }
1141     } test-branch-folding
1142 ] unit-test
1143
1144 [
1145     {
1146         T{ ##peek f V int-regs 0 D 0 }
1147         T{ ##load-reference f V int-regs 1 t }
1148         T{ ##branch }
1149     }
1150     0
1151 ] [
1152     {
1153         T{ ##peek f V int-regs 0 D 0 }
1154         T{ ##compare f V int-regs 1 V int-regs 0 V int-regs 0 cc<= }
1155         T{ ##compare-imm-branch f V int-regs 1 5 cc/= }
1156     } test-branch-folding
1157 ] unit-test
1158
1159 ! More branch folding tests
1160 V{ T{ ##branch } } 0 test-bb
1161
1162 V{
1163     T{ ##peek f V int-regs 0 D 0 }
1164     T{ ##compare-branch f V int-regs 0 V int-regs 0 cc< }
1165 } 1 test-bb
1166
1167 V{
1168     T{ ##load-immediate f V int-regs 1 1 }
1169     T{ ##branch }
1170 } 2 test-bb
1171
1172 V{
1173     T{ ##load-immediate f V int-regs 2 2 }
1174     T{ ##branch }
1175 } 3 test-bb
1176
1177 V{
1178     T{ ##phi f V int-regs 3 { } }
1179     T{ ##replace f V int-regs 3 D 0 }
1180     T{ ##return }
1181 } 4 test-bb
1182
1183 4 get instructions>> first
1184 2 get V int-regs 1 2array
1185 3 get V int-regs 2 2array 2array
1186 >>inputs drop
1187
1188 test-diamond
1189
1190 [ ] [
1191     cfg new 0 get >>entry
1192     value-numbering
1193     compute-predecessors
1194     destruct-ssa drop
1195 ] unit-test
1196
1197 [ 1 ] [ 1 get successors>> length ] unit-test
1198
1199 [ t ] [ 1 get successors>> first 3 get eq? ] unit-test
1200
1201 [ 2 ] [ 4 get instructions>> length ] unit-test
1202
1203 V{
1204     T{ ##peek f V int-regs 0 D 0 }
1205     T{ ##branch }
1206 } 0 test-bb
1207
1208 V{
1209     T{ ##peek f V int-regs 1 D 1 }
1210     T{ ##compare-branch f V int-regs 1 V int-regs 1 cc< }
1211 } 1 test-bb
1212
1213 V{
1214     T{ ##copy f V int-regs 2 V int-regs 0 }
1215     T{ ##branch }
1216 } 2 test-bb
1217
1218 V{
1219     T{ ##phi f V int-regs 3 V{ } }
1220     T{ ##branch }
1221 } 3 test-bb
1222
1223 V{
1224     T{ ##replace f V int-regs 3 D 0 }
1225     T{ ##return }
1226 } 4 test-bb
1227
1228 1 get V int-regs 1 2array
1229 2 get V int-regs 0 2array 2array 3 get instructions>> first (>>inputs)
1230
1231 test-diamond
1232
1233 [ ] [
1234     cfg new 0 get >>entry
1235     compute-predecessors
1236     value-numbering
1237     compute-predecessors
1238     eliminate-dead-code
1239     drop
1240 ] unit-test
1241
1242 [ t ] [ 1 get successors>> first 3 get eq? ] unit-test
1243
1244 [ 1 ] [ 3 get instructions>> first inputs>> assoc-size ] unit-test
1245
1246 V{ T{ ##prologue } T{ ##branch } } 0 test-bb
1247
1248 V{
1249     T{ ##peek { dst V int-regs 15 } { loc D 0 } }
1250     T{ ##copy { dst V int-regs 16 } { src V int-regs 15 } }
1251     T{ ##copy { dst V int-regs 17 } { src V int-regs 15 } }
1252     T{ ##copy { dst V int-regs 18 } { src V int-regs 15 } }
1253     T{ ##copy { dst V int-regs 19 } { src V int-regs 15 } }
1254     T{ ##compare
1255         { dst V int-regs 20 }
1256         { src1 V int-regs 18 }
1257         { src2 V int-regs 19 }
1258         { cc cc= }
1259         { temp V int-regs 22 }
1260     }
1261     T{ ##copy { dst V int-regs 21 } { src V int-regs 20 } }
1262     T{ ##compare-imm-branch
1263         { src1 V int-regs 21 }
1264         { src2 5 }
1265         { cc cc/= }
1266     }
1267 } 1 test-bb
1268
1269 V{
1270     T{ ##copy { dst V int-regs 23 } { src V int-regs 15 } }
1271     T{ ##copy { dst V int-regs 24 } { src V int-regs 15 } }
1272     T{ ##load-reference { dst V int-regs 25 } { obj t } }
1273     T{ ##branch }
1274 } 2 test-bb
1275
1276 V{
1277     T{ ##replace { src V int-regs 25 } { loc D 0 } }
1278     T{ ##epilogue }
1279     T{ ##return }
1280 } 3 test-bb
1281
1282 V{
1283     T{ ##copy { dst V int-regs 26 } { src V int-regs 15 } }
1284     T{ ##copy { dst V int-regs 27 } { src V int-regs 15 } }
1285     T{ ##add
1286         { dst V int-regs 28 }
1287         { src1 V int-regs 26 }
1288         { src2 V int-regs 27 }
1289     }
1290     T{ ##branch }
1291 } 4 test-bb
1292
1293 V{
1294     T{ ##replace { src V int-regs 28 } { loc D 0 } }
1295     T{ ##epilogue }
1296     T{ ##return }
1297 } 5 test-bb
1298
1299 0 get 1 get 1vector >>successors drop
1300 1 get 2 get 4 get V{ } 2sequence >>successors drop
1301 2 get 3 get 1vector >>successors drop
1302 4 get 5 get 1vector >>successors drop
1303
1304 [ ] [
1305     cfg new 0 get >>entry
1306     value-numbering eliminate-dead-code drop
1307 ] unit-test
1308
1309 [ f ] [ 1 get instructions>> [ ##peek? ] any? ] unit-test