Commit graph

522 commits

Author SHA1 Message Date
Quentin Carbonneaux
c744281317 uniformize looping on instructions
I am actually not sure if "i-b->ins < b->nins" is the best way,
maybe the comparison with the last instruction is a little more
efficient...  At least it is uniform now.
2015-11-16 17:54:16 -05:00
Quentin Carbonneaux
b8c7645746 improve the debug output of copy() 2015-11-13 15:43:23 -05:00
Quentin Carbonneaux
8c0574eaa1 fix buggy phi deletion in copy() 2015-11-13 15:34:03 -05:00
Quentin Carbonneaux
a670758b87 this is a buggy shortcut! 2015-11-13 15:28:40 -05:00
Quentin Carbonneaux
0aa9e83211 add initial version of copy elimination 2015-11-13 15:22:58 -05:00
Quentin Carbonneaux
8dcf6dceab export printref function 2015-11-13 15:22:33 -05:00
Quentin Carbonneaux
6ec5890628 change debug of ABI to A 2015-11-13 15:22:12 -05:00
Quentin Carbonneaux
cde5a4871b fix a few bugs in filluse() 2015-11-13 15:21:53 -05:00
Quentin Carbonneaux
3be8f0fef8 change initial vector size to 2 2015-11-13 13:12:35 -05:00
Quentin Carbonneaux
291c39565f store the use locations for temporaries 2015-11-13 13:12:22 -05:00
Quentin Carbonneaux
681fc07def get rid of dead assignment in fix4.ssa 2015-11-11 21:29:06 -05:00
Quentin Carbonneaux
a3a1fc0c80 move usage computation in filluse() 2015-11-11 21:21:54 -05:00
Quentin Carbonneaux
d3f1cd9483 add new ssa fixing example 2015-11-11 21:21:17 -05:00
Quentin Carbonneaux
33a4b128a9 add new test for ssa construction 2015-11-10 20:36:32 -05:00
Quentin Carbonneaux
4fdee5720a change debug formatting 2015-11-10 20:28:22 -05:00
Quentin Carbonneaux
2deff35ded add a few safeguards 2015-11-10 20:26:22 -05:00
Quentin Carbonneaux
9f1ecf974e fix some bugs, call ssa() in func() 2015-11-10 18:07:56 -05:00
Quentin Carbonneaux
351d0b4b61 now, cross fingers and test 2015-11-10 18:07:26 -05:00
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