summary refs log tree commit diff
path: root/lisc/rega.c
AgeCommit message (Collapse)Author
2015-09-15tweak block-border heuristic for reg. allocationQuentin Carbonneaux
We only allocate a register that has a hint if the hint register is not used already. In the max example it gives a better result and it does not seem to affect the collatz test.
2015-09-15refine the clobber codeQuentin Carbonneaux
It could very well be that the temporary we assign already got assigned to the right register! Good things happen.
2015-09-15fix two heuristics in regaQuentin Carbonneaux
There was a typo that made always the same successor to be selected for register allocation hinting. Also, I now attempt to prioritize hints over succeccor's choices as it appears to give slightly better results... Now that I think about it, the code re-using the most frequent successor block's assignment might be dead because all registers have hints if they got assigned once. To investigate.
2015-09-15remove round-robin in ralloc (need preferences)Quentin Carbonneaux
2015-09-15clobber check code was wrong in dopm()Quentin Carbonneaux
2015-09-15fix bug in parallel moves codeQuentin Carbonneaux
2015-09-15avoid depending on uninitialized rQuentin Carbonneaux
2015-09-15use the same bitset for regs and tmps in rega()Quentin Carbonneaux
This is possible because we know that they are represented by different integers.
2015-09-15major lifting: get rid of RRegQuentin Carbonneaux
I've been septic since I introduced it, this commit proves that it costs more than it helps. I've also fixed a bad bug in rega() where I alloc'ed the wrong size for internal arrays. Enums now have names so I can use them to cast in gdb to get the name corresponding to a constant.
2015-09-15prefix register macrosQuentin Carbonneaux
2015-09-15use round-robin in rallocQuentin Carbonneaux
This gives a more uniform use of the registers.
2015-09-15simplify frequent pred detection in regaQuentin Carbonneaux
2015-09-15fix 2 bad bugs in rega and improve substractionQuentin Carbonneaux
The substraction contrained the register allocator to allocate a different register for the result and the second operand, now, we use a neg trick to compile it down. The machinery that was setup is, regardless, interesting and will have to be used for floating point computations (division). The first bug in rega made broke the explicited loop invariant: we were using register allocation unavailable information from other blocks. It's still unclear how we got wrong results from that considering mappings are all 0-initialized. The second bug is a stupid one, one sizeof operator was missing from a memcpy...
2015-09-15use correct sizes during reg allocationQuentin Carbonneaux
2015-09-15use a new Ref type for registersQuentin Carbonneaux
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-15start work on word/long handlingQuentin Carbonneaux
2015-09-15clean the commutativity + fix bug in emitQuentin Carbonneaux
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-15add support for in-block reg. contraintsQuentin Carbonneaux
2015-09-15add crippled dce to the allocatorQuentin Carbonneaux
2015-09-15complete a crude register allocatorQuentin Carbonneaux
2015-09-15start work on parallel movesQuentin Carbonneaux
2015-09-15initiate work on reg allocationQuentin Carbonneaux