Commit graph

23 commits

Author SHA1 Message Date
Quentin Carbonneaux
1477dffe32 use cmp $0, it works with spill slots 2015-09-15 23:01:30 -04:00
Quentin Carbonneaux
9456200d91 use a new Ref type for registers
This might not be a good idea, the problem was that
many spurious registers would be added to the Bits
data-structures during compilation (and would
always remain 0).  However, doing the above
modification de-uniformizes the handling of temps
and regs, this makes the code longer and not
really nicer.  Also, additional Bits structures
are required to track the registers independently.

Overall this might be a bad idea to revert.
2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
d8d17705c4 clean the commutativity + fix bug in emit
The commutativity information only makes sense for
arithmetic expressions.  To account for that, I introduced
a new tri-valued boolean type B3.  Memory operations, for
example, will receive an undefined commutativity trit.

The code emitter was buggy when rega emitted instructions
like 'rax = add 1, rax', this is now fixed using the
commutativity information (we rewrite it in 'rax = add
rax, 1').
2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
fd964388f7 add a code emitter for at&t syntax 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
8aa8070248 simplify spiller
It seems that this logic of shuffling stuff around
between blocks should be handled by the register
allocator instead: it *will* have to shuffle
between registers, so we might as well mix some
spill locations in.
2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
b6633a13bc finish spiller, now needs testing! 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
e3356b23d5 standardize error message 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
f938fccd2b factor some spilling logic 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
da652b93f3 comment and fix if(BSET(..)) bug 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
2981a267f4 add slot addressing and some more spilling 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
49130f9edd prepare for block processing 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
eb1df2b81e refine assertion in cost computation 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
4f4d4cce6f rework spilling code for jump arguments 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
0d1595c770 refine precision of loop use sets 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
2a4fbbc6e0 move some debug output out of main 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
7202c7dedf simplify tests for hd 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
1891a810e8 nicer debug, bug fixed in loop detection 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
890c0ada0e attempt to fix loop uses/pressure in spill 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
bb2541693e correct phi usage accounting 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
037c1bf141 simplifications 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
a6168e6ed5 attempt more correct loop marking 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
8165e327e0 start working with loops in spill.c 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
73add5daae start work on spiller 2015-09-15 23:01:28 -04:00