Commit graph

504 commits

Author SHA1 Message Date
Quentin Carbonneaux
8f91dfb44a do not insert dead phis 2015-11-09 22:19:07 -05:00
Quentin Carbonneaux
8ed8f1cd4c provide BZERO macro for bitsets 2015-11-09 21:34:59 -05:00
Quentin Carbonneaux
b5330f2a44 recognize locals in phiins() 2015-11-09 21:30:38 -05:00
Quentin Carbonneaux
a8d5c13a3e precise OCall test in liveness 2015-11-09 21:29:55 -05:00
Quentin Carbonneaux
25d15ca89b modify data-structures for new ssa.c 2015-11-09 17:35:20 -05:00
Quentin Carbonneaux
c81ed54562 fix bug in frontier discovery 2015-11-09 17:00:57 -05:00
Quentin Carbonneaux
34b4e56ca4 start conventional ssa construction 2015-11-09 16:02:41 -05:00
Quentin Carbonneaux
058515be5e add new test in minic 2015-11-08 14:28:05 -05:00
Quentin Carbonneaux
fbf74646e1 uniformize temporary names in minic 2015-11-08 10:36:48 -05:00
Quentin Carbonneaux
5e0c991af9 another return fix in minic 2015-11-08 10:36:42 -05:00
Quentin Carbonneaux
1f2261b5a3 use the new && in test/prime.c 2015-11-06 19:22:49 -05:00
Quentin Carbonneaux
232b0356eb maybe fix small return bug in stmt() 2015-11-06 14:44:07 -05:00
Quentin Carbonneaux
217f216e72 experiment with && and || in minic 2015-11-06 14:30:38 -05:00
Quentin Carbonneaux
0b559fcd4d support lighter syntax for arrays 2015-11-05 09:57:30 -05:00
Quentin Carbonneaux
db1864d22a update align to use loadw 2015-11-04 18:39:20 -05:00
Quentin Carbonneaux
5f875c3261 update minic to the new IR 2015-11-03 17:01:12 -05:00
Quentin Carbonneaux
8ae9f786cb add interference hints 2015-11-03 16:48:27 -05:00
Quentin Carbonneaux
0679df0b56 break Tmp.phi chains at phi nodes
This makes sure the Tmp.phi "chain" is at most
two elements long.  Something smarted could be
possible, but union-find with path compression
is still not exactly what I want.
2015-11-01 13:55:06 -05:00
Quentin Carbonneaux
07c46bc6f9 support dots in idents for k0ga 2015-11-01 09:15:27 -05:00
Quentin Carbonneaux
46f99ac5b7 this emit was an emiti 2015-11-01 00:35:36 -04:00
Quentin Carbonneaux
7abf421ea2 make phi-class handling more local
The phi classes are no longer in a union-find
structure, instead each temporary argument of
a phi node gets a pointer to it.  The hinting
of the phi node is then shared with its the
one of its arguments.  When liveness proceeds
and finds out that two elements with same
hinting (a phi node and one of its arguments
or two arguments of the same phi node)
interfere, one of them has its phi pointer
reset, that way, the hinting won't be shared.
2015-10-31 23:39:52 -04:00
Quentin Carbonneaux
5b54910adc add simple dce into isel
This looks simple, but it's unclear that the use counts
are correct or at least sound after all the instruction
massaging that happens for calls/jumps.
2015-10-30 13:44:53 -04:00
Quentin Carbonneaux
62ff1f2f50 fix two bugs in spiller
1. In limit(), there can be machine registers that are
   live, thus we need to iterate from 0 (not Tmp0) to
   ntmp in the for loop building the array.
2. When an instruction can have a memory argument, we
   must not reload arguments that got spilled and were
   not live.  Instead, the must be replaced by SLOT()
   arguments.
2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
e68aac2cef use loadw in cprime.ssa 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
0a84de5e53 finish isel adressing modes and clear the code 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
d95c8f296b fix several bugs on Blk.gen in liveness 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
27bcd5a3c6 fillphi() now comes before filllive() 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
d43ebe8f58 break phi-classes following interferences 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
614130e431 remove liveness heuristic in fillphi() 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
dfede22dcd new regalloc heuristic for phis
At the beginning of each block look at the phi nodes that
have some arguments already allocated.  If the some
arguments from blocks with high execution frequency are
all assigned 'r', reset the the hint for the phi node to
this 'r'.  Combined with the following heuristic, this
can save some copies at the end of the destination blocks.
2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
56203de6df wip on regalloc new heuristics
I thought that many parallel copies generated
can be avoided if temporaries are in their hint
register at the beginning of blocks with multiple
predecessors.

To get more benefit, I suspect that we could
use a copy-propagating peephole pass.
2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
65c35372fd setup hints for function arguments 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
32ad5e368a prioritize reg. allocation of some temporaries 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
05f120431d this test optimization is sometimes incorrect 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
a9dc36e0eb change extension in sum example 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
d272f0896b simplify constant handling in amatch() 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
fb1c02657b fix bug in constants addition 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
9c29630dbf small fix in memory refs emission 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
10ef1c132b store constant addresses in Mem.offset 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
486915f501 print memory references in IR dumps 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
d1f048bc9c don't share mems containing temporaries
This can cause trouble in register allocation when
these temporaries get replaced by registers.  On
the other hand, offsetted slots and constants
can safely be shared.
2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
47a34dbd51 turn sum.ssa more C style 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
6d264a2594 port rega.c to work with RAMem 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
aa5682480c oops, another bug in sum.ssa 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
ab7a5c277a add support for RAMem in emit 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
039f9de5c5 port spill.c to work with RAMem 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
7ed3303036 mention addressing modes in isel main comment 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
e0d7beda69 fix typo bug in liveness 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
04b66d38db start integrating RAMem references 2015-10-30 13:20:42 -04:00
Quentin Carbonneaux
b33febc25c prepare for using memory refs 2015-10-30 13:20:42 -04:00