Commit graph

184 commits

Author SHA1 Message Date
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
1a78659dfa cosmetics 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
390045cae1 compress parsref code a little 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
92be2fdd17 start improving constants support 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
837c46ca81 add TODO 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
33b0d919e8 add support for in-block reg. contraints 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
bd0a00e555 perform isel before code emission 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
d8e40a56ec emit some x86-sepcific instructions 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
5fe13b14e2 compile emit module 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
5f14d7fd7c silence clang warning 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
854ecd4009 add crippled dce to the allocator 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
8899449c39 complete a crude register allocator 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
ee784dbfcd start work on parallel moves 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
33fe5637c5 initiate work on reg allocation 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
48f90356e0 new euclidean division test 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
5bd9deac8d add more printing support 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
5ac9fbd8e4 new spill test 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
36da4b30cc test isel 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
df0836e475 isel logic was moved to spill 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
ea811ab7c2 add simple spill test 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
abdcbe845a this makefile fu was useless 2015-09-15 23:01:29 -04:00
Quentin Carbonneaux
ee961fb487 always preserve last build 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
58c314eeaf cosmetics 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
b35a7d2acd alt.ssa was in buggy ssa form 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
5ad565e299 improve output, add debug array 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
6e8e6d3368 show more spilling data 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
3538e769a7 add a live-through temporary to test alt 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
4f9a5df76b more testing code 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
7f8a6d025c test code for the spiller 2015-09-15 23:01:28 -04:00
Quentin Carbonneaux
595ad96a34 cosmetics 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
0f0ee0466e rework liveness to compute reg pressure 2015-09-15 23:01:28 -04:00