This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.txt
959 lines (923 loc) · 41.6 KB
/
log.txt
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
['main.py', 'src/call.pl0', 'obj/call.s']
start <function Parser.program at 0xffffb964fee0>
getsym: varsym var
start <function Parser.block at 0xffffb964fb80>
accepting constsym == varsym
accepting varsym == varsym
getsym: ident x
start <function Parser.vardef at 0xffffb964fdc0>
expecting ident
accepting ident == ident
getsym: comma ,
accepting lspar == comma
accepting colon == comma
end <function Parser.vardef at 0xffffb964fdc0>
accepting comma == comma
getsym: ident squ
start <function Parser.vardef at 0xffffb964fdc0>
expecting ident
accepting ident == ident
getsym: semicolon ;
accepting lspar == semicolon
accepting colon == semicolon
end <function Parser.vardef at 0xffffb964fdc0>
accepting comma == semicolon
expecting semicolon
accepting semicolon == semicolon
getsym: procsym procedure
accepting constsym == procsym
accepting varsym == procsym
accepting paramsym == procsym
accepting procsym == procsym
getsym: ident square
expecting ident
accepting ident == ident
getsym: lparen (
accepting lparen == lparen
getsym: ident y
start <function Parser.vardef at 0xffffb964fdc0>
expecting ident
accepting ident == ident
getsym: rparen )
accepting lspar == rparen
accepting colon == rparen
end <function Parser.vardef at 0xffffb964fdc0>
accepting comma == rparen
expecting rparen
accepting rparen == rparen
getsym: varsym var
DEBUG: function square with 1 parameters
start <function Parser.block at 0xffffb964fb80>
accepting constsym == varsym
accepting varsym == varsym
getsym: ident y
start <function Parser.vardef at 0xffffb964fdc0>
expecting ident
accepting ident == ident
getsym: semicolon ;
accepting lspar == semicolon
accepting colon == semicolon
end <function Parser.vardef at 0xffffb964fdc0>
accepting comma == semicolon
expecting semicolon
accepting semicolon == semicolon
getsym: beginsym begin
accepting constsym == beginsym
accepting varsym == beginsym
accepting paramsym == beginsym
accepting procsym == beginsym
start <function Parser.statement at 0xffffb964fa60>
accepting ident == beginsym
accepting callsym == beginsym
accepting beginsym == beginsym
getsym: ident y
StatList : new 281473792177440
start <function Parser.statement at 0xffffb964fa60>
accepting ident == ident
getsym: becomes :=
Looking up y
Looking up y
expecting becomes
accepting becomes == becomes
getsym: ident y
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: times *
Looking up y
Looking up y
accepting inc == times
end <function Parser.factor at 0xffffb964f5e0>
getsym: ident y
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: semicolon ;
Looking up y
Looking up y
accepting inc == semicolon
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791872592 of type <class 'ir.AssignStat'> to 281473792177440
accepting semicolon == semicolon
getsym: retsym return
start <function Parser.statement at 0xffffb964fa60>
accepting ident == retsym
accepting callsym == retsym
accepting beginsym == retsym
accepting ifsym == retsym
accepting whilesym == retsym
accepting forsym == retsym
accepting print == retsym
accepting read == retsym
accepting retsym == retsym
getsym: ident y
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: endsym end
Looking up y
Looking up y
accepting inc == endsym
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791872736 of type <class 'ir.ReturnStat'> to 281473792177440
accepting semicolon == endsym
expecting endsym
accepting endsym == endsym
getsym: beginsym begin
StatList 281473792177440 : [ 281473791872592 281473791872736 ]
end <function Parser.statement at 0xffffb964fa60>
end <function Parser.block at 0xffffb964fb80>
Looking up square
accepting procsym == beginsym
start <function Parser.statement at 0xffffb964fa60>
accepting ident == beginsym
accepting callsym == beginsym
accepting beginsym == beginsym
getsym: ident x
StatList : new 281473791872928
start <function Parser.statement at 0xffffb964fa60>
accepting ident == ident
getsym: becomes :=
Looking up x
Looking up x
expecting becomes
accepting becomes == becomes
getsym: minus -
start <function Parser.expression at 0xffffb964f820>
getsym: number 1
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == number
accepting number == number
getsym: semicolon ;
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791930624 of type <class 'ir.AssignStat'> to 281473791872928
accepting semicolon == semicolon
getsym: print !
start <function Parser.statement at 0xffffb964fa60>
accepting ident == print
accepting callsym == print
accepting beginsym == print
accepting ifsym == print
accepting whilesym == print
accepting forsym == print
accepting print == print
getsym: ident x
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: semicolon ;
Looking up x
Looking up x
accepting inc == semicolon
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791930768 of type <class 'ir.PrintStat'> to 281473791872928
accepting semicolon == semicolon
getsym: ident x
start <function Parser.statement at 0xffffb964fa60>
accepting ident == ident
getsym: becomes :=
Looking up x
Looking up x
expecting becomes
accepting becomes == becomes
getsym: callsym call
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == callsym
accepting number == callsym
accepting lparen == callsym
accepting callsym == callsym
getsym: ident square
expecting ident
accepting ident == ident
getsym: lparen (
Looking up square
accepting lparen == lparen
getsym: ident x
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: rparen )
Looking up x
Looking up x
accepting inc == rparen
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
expecting rparen
accepting rparen == rparen
getsym: semicolon ;
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791931152 of type <class 'ir.AssignStat'> to 281473791872928
accepting semicolon == semicolon
getsym: print !
start <function Parser.statement at 0xffffb964fa60>
accepting ident == print
accepting callsym == print
accepting beginsym == print
accepting ifsym == print
accepting whilesym == print
accepting forsym == print
accepting print == print
getsym: ident x
start <function Parser.expression at 0xffffb964f820>
start <function Parser.term at 0xffffb964f700>
start <function Parser.factor at 0xffffb964f5e0>
accepting ident == ident
getsym: endsym end
Looking up x
Looking up x
accepting inc == endsym
end <function Parser.factor at 0xffffb964f5e0>
end <function Parser.term at 0xffffb964f700>
end <function Parser.expression at 0xffffb964f820>
end <function Parser.statement at 0xffffb964fa60>
StatList: appending 281473791931296 of type <class 'ir.PrintStat'> to 281473791872928
accepting semicolon == endsym
expecting endsym
accepting endsym == endsym
getsym: period .
StatList 281473791872928 : [ 281473791930624 281473791930768 281473791931152 281473791931296 ]
end <function Parser.statement at 0xffffb964fa60>
end <function Parser.block at 0xffffb964fb80>
expecting period
accepting period == period
end <function Parser.program at 0xffffb964fee0>
<class 'ir.Block'> 281473791931440 {
<<<<<----- BUG? MISSING PARENT
global_symtab: SymbolTable:
defs: <class 'ir.DefinitionList'> 281473792137584 {
parent = 281473791931440
children:
<class 'ir.FunctionDef'> 281473791872832 {
parent = 281473792137584
body: <class 'ir.Block'> 281473791872784 {
parent = 281473791872832
global_symtab: SymbolTable:
global int x
global int squ
param int return
auto function square
defs: <class 'ir.DefinitionList'> 281473792177392 {
parent = 281473791872784
}
body: <class 'ir.StatList'> 281473792177440 {
parent = 281473791872784
children:
<class 'ir.AssignStat'> 281473791872592 {
parent = 281473792177440
expr: <class 'ir.BinExpr'> 281473791872496 {
parent = 281473791872592
children:
'times'
<class 'ir.Var'> 281473791872304 {
parent = 281473791872496
symbol: auto int y
}
<class 'ir.Var'> 281473791872400 {
parent = 281473791872496
symbol: auto int y
}
}
offset: None
symbol: auto int y
}
<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.Var'> 281473791872640 {
parent = 281473791872736
symbol: auto int y
}
}
}
}
symbol: auto function square
}
}
body: <class 'ir.StatList'> 281473791872928 {
parent = 281473791931440
children:
<class 'ir.AssignStat'> 281473791930624 {
parent = 281473791872928
expr: <class 'ir.UnExpr'> 281473791930528 {
parent = 281473791930624
children:
'minus'
<class 'ir.Const'> 281473791930432 {
parent = 281473791930528
value: 1
symbol: None
}
}
offset: None
symbol: global int x
}
<class 'ir.PrintStat'> 281473791930768 {
parent = 281473791872928
children:
<class 'ir.Var'> 281473791930672 {
parent = 281473791930768
symbol: global int x
}
expr: <class 'ir.Var'> 281473791930672 {
parent = 281473791930768
symbol: global int x
}
}
<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: <class 'ir.CallStat'> 281473791931056 {
parent = 281473791931152
call: <class 'ir.CallExpr'> 281473791930960 {
parent = 281473791931056
children:
<class 'ir.Var'> 281473791930864 {
parent = 281473791930960
symbol: global int x
}
symbol: auto function square
}
}
offset: None
symbol: global int x
}
<class 'ir.PrintStat'> 281473791931296 {
parent = 281473791872928
children:
<class 'ir.Var'> 281473791931200 {
parent = 281473791931296
symbol: global int x
}
expr: <class 'ir.Var'> 281473791931200 {
parent = 281473791931296
symbol: global int x
}
}
}
}
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
<class 'ir.DefinitionList'> 281473792177392
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 2
navigating children of <class 'ir.BinExpr'> 281473791872496 3
<class 'ir.Var'> 281473791872304
<class 'ir.Var'> 281473791872400
<class 'ir.BinExpr'> 281473791872496
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791872592
<class 'ir.AssignStat'> 281473791872592
<class 'ir.Var'> 281473791872640
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
<class 'ir.ReturnStat'> 281473791872736
<class 'ir.StatList'> 281473792177440
StatList 281473792177440 : [ 281473791872592 281473791872736 ]
successfully navigated attr body of <class 'ir.Block'> 281473791872784
<class 'ir.Block'> 281473791872784
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
<class 'ir.FunctionDef'> 281473791872832
<class 'ir.DefinitionList'> 281473792137584
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 4
navigating children of <class 'ir.UnExpr'> 281473791930528 2
<class 'ir.Const'> 281473791930432
<class 'ir.UnExpr'> 281473791930528
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791930624
<class 'ir.AssignStat'> 281473791930624
navigating children of <class 'ir.PrintStat'> 281473791930768 1
<class 'ir.Var'> 281473791930672
<class 'ir.Var'> 281473791930672
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791930768
<class 'ir.PrintStat'> 281473791930768
navigating children of <class 'ir.CallExpr'> 281473791930960 1
<class 'ir.Var'> 281473791930864
<class 'ir.CallExpr'> 281473791930960
successfully navigated attr call of <class 'ir.CallStat'> 281473791931056
<class 'ir.CallStat'> 281473791931056
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
<class 'ir.AssignStat'> 281473791931152
navigating children of <class 'ir.PrintStat'> 281473791931296 1
<class 'ir.Var'> 281473791931200
<class 'ir.Var'> 281473791931200
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791931296
<class 'ir.PrintStat'> 281473791931296
<class 'ir.StatList'> 281473791872928
StatList 281473791872928 : [ 281473791930624 281473791930768 281473791931152 281473791931296 ]
successfully navigated attr body of <class 'ir.Block'> 281473791931440
<class 'ir.Block'> 281473791931440
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 2
navigating children of <class 'ir.BinExpr'> 281473791872496 3
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791872592
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
successfully navigated attr body of <class 'ir.Block'> 281473791872784
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 4
navigating children of <class 'ir.UnExpr'> 281473791930528 2
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791930624
navigating children of <class 'ir.PrintStat'> 281473791930768 1
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791930768
navigating children of <class 'ir.CallExpr'> 281473791930960 1
successfully navigated attr call of <class 'ir.CallStat'> 281473791931056
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
navigating children of <class 'ir.PrintStat'> 281473791931296 1
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791931296
successfully navigated attr body of <class 'ir.Block'> 281473791931440
<class 'ir.DefinitionList'> 281473792177392 -> <class 'ir.Block'> 281473791872784
<class 'ir.Var'> 281473791872304 -> <class 'ir.BinExpr'> 281473791872496
<class 'ir.Var'> 281473791872400 -> <class 'ir.BinExpr'> 281473791872496
<class 'ir.BinExpr'> 281473791872496 -> <class 'ir.AssignStat'> 281473791872592
<class 'ir.AssignStat'> 281473791872592 -> <class 'ir.StatList'> 281473792177440
<class 'ir.Var'> 281473791872640 -> <class 'ir.ReturnStat'> 281473791872736
<class 'ir.ReturnStat'> 281473791872736 -> <class 'ir.StatList'> 281473792177440
<class 'ir.StatList'> 281473792177440 -> <class 'ir.Block'> 281473791872784
<class 'ir.Block'> 281473791872784 -> <class 'ir.FunctionDef'> 281473791872832
<class 'ir.FunctionDef'> 281473791872832 -> <class 'ir.DefinitionList'> 281473792137584
<class 'ir.DefinitionList'> 281473792137584 -> <class 'ir.Block'> 281473791931440
<class 'ir.Const'> 281473791930432 -> <class 'ir.UnExpr'> 281473791930528
<class 'ir.UnExpr'> 281473791930528 -> <class 'ir.AssignStat'> 281473791930624
<class 'ir.AssignStat'> 281473791930624 -> <class 'ir.StatList'> 281473791872928
<class 'ir.Var'> 281473791930672 -> <class 'ir.PrintStat'> 281473791930768
<class 'ir.PrintStat'> 281473791930768 -> <class 'ir.StatList'> 281473791872928
<class 'ir.Var'> 281473791930864 -> <class 'ir.CallExpr'> 281473791930960
<class 'ir.CallExpr'> 281473791930960 -> <class 'ir.CallStat'> 281473791931056
<class 'ir.CallStat'> 281473791931056 -> <class 'ir.AssignStat'> 281473791931152
<class 'ir.AssignStat'> 281473791931152 -> <class 'ir.StatList'> 281473791872928
<class 'ir.Var'> 281473791931200 -> <class 'ir.PrintStat'> 281473791931296
<class 'ir.PrintStat'> 281473791931296 -> <class 'ir.StatList'> 281473791872928
<class 'ir.StatList'> 281473791872928 -> <class 'ir.Block'> 281473791931440
<class 'ir.Block'> 281473791931440 -> <class 'NoneType'> 9221552
Total nodes in IR: 24
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
Cannot lower 281473792177392 <class 'ir.DefinitionList'> 'DefinitionList' object has no attribute 'lower'
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 2
navigating children of <class 'ir.BinExpr'> 281473791872496 3
StatList : new 281473791931632
Lowering <class 'ir.Var'> 281473791872304
StatList : new 281473791931920
Lowering <class 'ir.Var'> 281473791872400
StatList : new 281473791932160
Lowering <class 'ir.BinExpr'> 281473791872496
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791872592
StatList : new 281473791932352
Lowering <class 'ir.AssignStat'> 281473791872592
StatList : new 281473791932496
Lowering <class 'ir.Var'> 281473791872640
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
[DEBUG] ReturnStat.expr : <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y
}
Cannot lower 281473791872736 <class 'ir.ReturnStat'> name 'RetStat' is not defined
Cannot lower 281473792177440 <class 'ir.StatList'> 'StatList' object has no attribute 'lower'
successfully navigated attr body of <class 'ir.Block'> 281473791872784
Cannot lower 281473791872784 <class 'ir.Block'> 'Block' object has no attribute 'lower'
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
Cannot lower 281473791872832 <class 'ir.FunctionDef'> 'FunctionDef' object has no attribute 'lower'
Cannot lower 281473792137584 <class 'ir.DefinitionList'> 'DefinitionList' object has no attribute 'lower'
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 4
navigating children of <class 'ir.UnExpr'> 281473791930528 2
StatList : new 281473791931776
Lowering <class 'ir.Const'> 281473791930432
StatList : new 281473791932880
Lowering <class 'ir.UnExpr'> 281473791930528
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791930624
StatList : new 281473791933024
Lowering <class 'ir.AssignStat'> 281473791930624
navigating children of <class 'ir.PrintStat'> 281473791930768 1
StatList : new 281473791933168
Lowering <class 'ir.Var'> 281473791930672
StatList : new 281473791933360
Lowering <class 'ir.Var'> 281473791930672
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791930768
StatList : new 281473791933504
Lowering <class 'ir.PrintStat'> 281473791930768
navigating children of <class 'ir.CallExpr'> 281473791930960 1
StatList : new 281473791933744
Lowering <class 'ir.Var'> 281473791930864
Cannot lower 281473791930960 <class 'ir.CallExpr'> 'CallExpr' object has no attribute 'lower'
successfully navigated attr call of <class 'ir.CallStat'> 281473791931056
Lowering <class 'ir.CallStat'> 281473791931056
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
Cannot lower 281473791931152 <class 'ir.AssignStat'> 'BranchStat' object has no attribute 'destination'
navigating children of <class 'ir.PrintStat'> 281473791931296 1
StatList : new 281473791934032
Lowering <class 'ir.Var'> 281473791931200
StatList : new 281473791934176
Lowering <class 'ir.Var'> 281473791931200
successfully navigated attr expr of <class 'ir.PrintStat'> 281473791931296
StatList : new 281473791934320
Lowering <class 'ir.PrintStat'> 281473791931296
Cannot lower 281473791872928 <class 'ir.StatList'> 'StatList' object has no attribute 'lower'
successfully navigated attr body of <class 'ir.Block'> 281473791931440
Cannot lower 281473791931440 <class 'ir.Block'> 'Block' object has no attribute 'lower'
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 2
navigating children of <class 'ir.StatList'> 281473791932352 2
navigating children of <class 'ir.StatList'> 281473791932160 3
navigating children of <class 'ir.StatList'> 281473791931632 1
navigating children of <class 'ir.StatList'> 281473791931920 1
navigating children of <class 'ir.StatList'> 281473791932496 1
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
successfully navigated attr body of <class 'ir.Block'> 281473791872784
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 4
navigating children of <class 'ir.StatList'> 281473791933024 2
navigating children of <class 'ir.StatList'> 281473791932880 2
navigating children of <class 'ir.StatList'> 281473791931776 1
navigating children of <class 'ir.StatList'> 281473791933504 2
navigating children of <class 'ir.StatList'> 281473791933360 1
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
navigating children of <class 'ir.StatList'> 281473791934320 2
navigating children of <class 'ir.StatList'> 281473791934176 1
successfully navigated attr body of <class 'ir.Block'> 281473791931440
<class 'ir.Block'> 281473791931440 {
<<<<<----- BUG? MISSING PARENT
global_symtab: SymbolTable:
defs: <class 'ir.DefinitionList'> 281473792137584 {
parent = 281473791931440
children:
<class 'ir.FunctionDef'> 281473791872832 {
parent = 281473792137584
body: <class 'ir.Block'> 281473791872784 {
parent = 281473791872832
global_symtab: SymbolTable:
global int x
global int squ
param int return
auto function square
defs: <class 'ir.DefinitionList'> 281473792177392 {
parent = 281473791872784
}
body: <class 'ir.StatList'> 281473792177440 {
parent = 281473791872784
children:
<class 'ir.StatList'> 281473791932352 {
parent = 281473792177440
children:
<class 'ir.StatList'> 281473791932160 {
parent = 281473791932352
children:
<class 'ir.StatList'> 281473791931632 {
parent = 281473791932160
children:
reg int t0 <- auto int y
}
<class 'ir.StatList'> 281473791931920 {
parent = 281473791932160
children:
reg int t1 <- auto int y
}
reg int32_t t2 <- reg int t0 times reg int t1
}
auto int y <- reg int32_t t2
}
<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y
}
}
}
}
symbol: auto function square
}
}
body: <class 'ir.StatList'> 281473791872928 {
parent = 281473791931440
children:
<class 'ir.StatList'> 281473791933024 {
parent = 281473791872928
children:
<class 'ir.StatList'> 281473791932880 {
parent = 281473791933024
children:
<class 'ir.StatList'> 281473791931776 {
parent = 281473791932880
children:
reg int t4 <- 1
}
reg int t5 <- minus reg int t4
}
global int x <- reg int t5
}
<class 'ir.StatList'> 281473791933504 {
parent = 281473791872928
children:
<class 'ir.StatList'> 281473791933360 {
parent = 281473791933504
children:
reg int t7 <- global int x
}
print reg int t7
}
<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x
}
<class 'ir.StatList'> 281473791934320 {
parent = 281473791872928
children:
<class 'ir.StatList'> 281473791934176 {
parent = 281473791934320
children:
reg int t10 <- global int x
}
print reg int t10
}
}
}
<class 'ir.DefinitionList'> 281473792177392
<class 'ir.LoadStat'> 281473791931488
<class 'ir.StatList'> 281473791931632
Flattening 281473791931632 into 281473791932160
<class 'ir.LoadStat'> 281473791931872
<class 'ir.StatList'> 281473791931920
Flattening 281473791931920 into 281473791932160
<class 'ir.BinStat'> 281473791932016
<class 'ir.StatList'> 281473791932160
Flattening 281473791932160 into 281473791932352
<class 'ir.StoreStat'> 281473791932304
<class 'ir.StatList'> 281473791932352
Flattening 281473791932352 into 281473792177440
<class 'ir.LoadStat'> 281473791932256
<class 'ir.StatList'> 281473791932496
Not flattening 281473791932496 into 281473791872736 of type <class 'ir.ReturnStat'>
<class 'ir.ReturnStat'> 281473791872736
<class 'ir.StatList'> 281473792177440
Not flattening 281473792177440 into 281473791872784 of type <class 'ir.Block'>
<class 'ir.Block'> 281473791872784
<class 'ir.FunctionDef'> 281473791872832
<class 'ir.DefinitionList'> 281473792137584
<class 'ir.LoadImmStat'> 281473791931728
<class 'ir.StatList'> 281473791931776
Flattening 281473791931776 into 281473791932880
<class 'ir.UnaryStat'> 281473791932688
<class 'ir.StatList'> 281473791932880
Flattening 281473791932880 into 281473791933024
<class 'ir.StoreStat'> 281473791932976
<class 'ir.StatList'> 281473791933024
Flattening 281473791933024 into 281473791872928
<class 'ir.LoadStat'> 281473791933216
<class 'ir.StatList'> 281473791933360
Flattening 281473791933360 into 281473791933504
<class 'ir.PrintCommand'> 281473791933456
<class 'ir.StatList'> 281473791933504
Flattening 281473791933504 into 281473791872928
<class 'ir.BranchStat'> 281473791933792
<class 'ir.AssignStat'> 281473791931152
<class 'ir.LoadStat'> 281473791933984
<class 'ir.StatList'> 281473791934176
Flattening 281473791934176 into 281473791934320
<class 'ir.PrintCommand'> 281473791934272
<class 'ir.StatList'> 281473791934320
Flattening 281473791934320 into 281473791872928
<class 'ir.StatList'> 281473791872928
Not flattening 281473791872928 into 281473791931440 of type <class 'ir.Block'>
<class 'ir.Block'> 281473791931440
<class 'ir.Block'> 281473791931440 {
<<<<<----- BUG? MISSING PARENT
global_symtab: SymbolTable:
defs: <class 'ir.DefinitionList'> 281473792137584 {
parent = 281473791931440
children:
<class 'ir.FunctionDef'> 281473791872832 {
parent = 281473792137584
body: <class 'ir.Block'> 281473791872784 {
parent = 281473791872832
global_symtab: SymbolTable:
global int x
global int squ
param int return
auto function square
defs: <class 'ir.DefinitionList'> 281473792177392 {
parent = 281473791872784
}
body: <class 'ir.StatList'> 281473792177440 {
parent = 281473791872784
children:
reg int t0 <- auto int y
reg int t1 <- auto int y
reg int32_t t2 <- reg int t0 times reg int t1
auto int y <- reg int32_t t2
<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y
}
}
}
}
symbol: auto function square
}
}
body: <class 'ir.StatList'> 281473791872928 {
parent = 281473791931440
children:
reg int t4 <- 1
reg int t5 <- minus reg int t4
global int x <- reg int t5
reg int t7 <- global int x
print reg int t7
<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x
}
reg int t10 <- global int x
print reg int t10
}
}
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 5
navigating children of <class 'ir.StatList'> 281473791932496 1
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
successfully navigated attr body of <class 'ir.Block'> 281473791872784
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 8
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
successfully navigated attr body of <class 'ir.Block'> 281473791931440
DATALAYOUT
<class 'ir.Block'> 281473791931440 {
<<<<<----- BUG? MISSING PARENT
global_symtab: SymbolTable:
defs: <class 'ir.DefinitionList'> 281473792137584 {
parent = 281473791931440
children:
<class 'ir.FunctionDef'> 281473791872832 {
parent = 281473792137584
body: <class 'ir.Block'> 281473791872784 {
parent = 281473791872832
global_symtab: SymbolTable:
global int x; _g_x: def byte 4
global int squ; _g_squ: def byte 4
param int return; _g_return: def byte 4
auto function square
defs: <class 'ir.DefinitionList'> 281473792177392 {
parent = 281473791872784
}
body: <class 'ir.StatList'> 281473792177440 {
parent = 281473791872784
children:
reg int t0 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
reg int t1 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
reg int32_t t2 <- reg int t0 times reg int t1
auto int y; _l_square_y: fp + (-4) [def byte 4] <- reg int32_t t2
<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
}
}
}
}
symbol: auto function square
}
}
body: <class 'ir.StatList'> 281473791872928 {
parent = 281473791931440
children:
reg int t4 <- 1
reg int t5 <- minus reg int t4
global int x; _g_x: def byte 4 <- reg int t5
reg int t7 <- global int x; _g_x: def byte 4
print reg int t7
<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x; _g_x: def byte 4
}
reg int t10 <- global int x; _g_x: def byte 4
print reg int t10
}
}
navigating children of <class 'ir.DefinitionList'> 281473792137584 1
successfully navigated attr defs of <class 'ir.Block'> 281473791872784
navigating children of <class 'ir.StatList'> 281473792177440 5
navigating children of <class 'ir.StatList'> 281473791932496 1
successfully navigated attr expr of <class 'ir.ReturnStat'> 281473791872736
successfully navigated attr body of <class 'ir.Block'> 281473791872784
successfully navigated attr body of <class 'ir.FunctionDef'> 281473791872832
successfully navigated attr defs of <class 'ir.Block'> 281473791931440
navigating children of <class 'ir.StatList'> 281473791872928 8
successfully navigated attr expr of <class 'ir.AssignStat'> 281473791931152
successfully navigated attr body of <class 'ir.Block'> 281473791931440
Liveness sets
281473791931200 [label="BB281473791931200{\nreg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]}"];
281473791931200 -> exit281473791872832 [label="{global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]}"];
gen: {auto int y; _l_square_y: fp + (-4) [def byte 4]}
kill: {reg int t3}
live_in: {global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]}
live_out: {global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]}
281473791932592 [label="BB281473791932592{\nreg int t0 <- auto int y; _l_square_y: fp + (-4) [def byte 4]\nreg int t1 <- auto int y; _l_square_y: fp + (-4) [def byte 4]\nreg int32_t t2 <- reg int t0 times reg int t1\nauto int y; _l_square_y: fp + (-4) [def byte 4] <- reg int32_t t2\n<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
}
}}"];
281473791932592 -> exit281473791872832 [label="{global int x; _g_x: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4], global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}"];
gen: {auto int y; _l_square_y: fp + (-4) [def byte 4]}
kill: {reg int t1, reg int t0, reg int32_t t2, auto int y; _l_square_y: fp + (-4) [def byte 4]}
live_in: {global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]}
live_out: {global int x; _g_x: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4], global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}
281473791930528 [label="BB281473791930528{\nreg int t4 <- 1\nreg int t5 <- minus reg int t4\nglobal int x; _g_x: def byte 4 <- reg int t5\nreg int t7 <- global int x; _g_x: def byte 4\nprint reg int t7\n<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x; _g_x: def byte 4
}\nreg int t10 <- global int x; _g_x: def byte 4\nprint reg int t10}"];
281473791930528 -> exit281473792670448 [label="set()"];
gen: set()
kill: {global int x; _g_x: def byte 4, reg int t10, reg int t4, reg int t5, reg int t7}
live_in: set()
live_out: set()
Instruction liveness
BASIC BLOCK:
281473791931200 [label="BB281473791931200{\nreg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]}"];
281473791931200 -> exit281473791872832 [label="{global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]}"];
inst=reg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4] live_in={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]} live_out={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}
BASIC BLOCK:
281473791932592 [label="BB281473791932592{\nreg int t0 <- auto int y; _l_square_y: fp + (-4) [def byte 4]\nreg int t1 <- auto int y; _l_square_y: fp + (-4) [def byte 4]\nreg int32_t t2 <- reg int t0 times reg int t1\nauto int y; _l_square_y: fp + (-4) [def byte 4] <- reg int32_t t2\n<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
}
}}"];
281473791932592 -> exit281473791872832 [label="{global int x; _g_x: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4], global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}"];
inst=reg int t0 <- auto int y; _l_square_y: fp + (-4) [def byte 4] live_in={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4]} live_out={global int x; _g_x: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4], global int squ; _g_squ: def byte 4, reg int t0, param int return; _g_return: def byte 4}
inst=reg int t1 <- auto int y; _l_square_y: fp + (-4) [def byte 4] live_in={global int x; _g_x: def byte 4, auto int y; _l_square_y: fp + (-4) [def byte 4], global int squ; _g_squ: def byte 4, reg int t0, param int return; _g_return: def byte 4} live_out={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, reg int t1, reg int t0, param int return; _g_return: def byte 4}
inst=reg int32_t t2 <- reg int t0 times reg int t1 live_in={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, reg int t1, reg int t0, param int return; _g_return: def byte 4} live_out={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, reg int32_t t2, param int return; _g_return: def byte 4}
inst=auto int y; _l_square_y: fp + (-4) [def byte 4] <- reg int32_t t2 live_in={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, reg int32_t t2, param int return; _g_return: def byte 4} live_out={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}
inst=<class 'ir.ReturnStat'> 281473791872736 {
parent = 281473792177440
expr: <class 'ir.StatList'> 281473791932496 {
parent = 281473791872736
children:
reg int t3 <- auto int y; _l_square_y: fp + (-4) [def byte 4]
}
} live_in={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4} live_out={global int x; _g_x: def byte 4, global int squ; _g_squ: def byte 4, param int return; _g_return: def byte 4}
BASIC BLOCK:
281473791930528 [label="BB281473791930528{\nreg int t4 <- 1\nreg int t5 <- minus reg int t4\nglobal int x; _g_x: def byte 4 <- reg int t5\nreg int t7 <- global int x; _g_x: def byte 4\nprint reg int t7\n<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x; _g_x: def byte 4
}\nreg int t10 <- global int x; _g_x: def byte 4\nprint reg int t10}"];
281473791930528 -> exit281473792670448 [label="set()"];
inst=reg int t4 <- 1 live_in=set() live_out={reg int t4}
inst=reg int t5 <- minus reg int t4 live_in={reg int t4} live_out={reg int t5}
inst=global int x; _g_x: def byte 4 <- reg int t5 live_in={reg int t5} live_out={global int x; _g_x: def byte 4}
inst=reg int t7 <- global int x; _g_x: def byte 4 live_in={global int x; _g_x: def byte 4} live_out={reg int t7}
inst=print reg int t7 live_in={reg int t7} live_out=set()
inst=<class 'ir.AssignStat'> 281473791931152 {
parent = 281473791872928
expr: call to auto function square
offset: None
symbol: global int x; _g_x: def byte 4
} live_in=set() live_out={global int x; _g_x: def byte 4}
inst=reg int t10 <- global int x; _g_x: def byte 4 live_in={global int x; _g_x: def byte 4} live_out={reg int t10}
inst=print reg int t10 live_in={reg int t10} live_out=set()
REGALLOC
DEBUG:
[{'var': reg int t7, 'interv': range(9, 10)}, {'var': reg int t1, 'interv': range(2, 3)}, {'var': reg int t5, 'interv': range(7, 8)}, {'var': reg int t10, 'interv': range(12, 13)}, {'var': reg int t4, 'interv': range(6, 7)}, {'var': reg int32_t t2, 'interv': range(3, 4)}, {'var': reg int t0, 'interv': range(1, 3)}, {'var': reg int t3, 'interv': range(0, 0)}]