summary refs log tree commit diff
path: root/lisc/spill.c
AgeCommit message (Collapse)Author
2016-02-26bug in liveout()Quentin Carbonneaux
Because of the bsclr() call, liveout was not actually making the union correctly. Instead of performing an union, it now fully sets the bitset passed as parameter.
2016-02-26use bitset in spill.cQuentin Carbonneaux
2016-02-22cosmeticsQuentin Carbonneaux
2016-02-21do not spill dead phisQuentin Carbonneaux
Regalloc will be able to handle these spurious phis, however, some other spurious dead instructions can be emitted. It would be better to get rid of them upfront; maybe by modifying isel, or by inserting a proper dce pass. An example of that undesirable behavior is exposed below. @l1 %foo =w ... @l2 %dead =w phi @l1 %foo, ...
2016-02-18stop using OXxx1 and use new OLoadQuentin Carbonneaux
2016-02-04iterate correctly on blocks in spiller...Quentin Carbonneaux
2016-02-04fix hinting bug in spillerQuentin Carbonneaux
We have to first free the output register of an instruction before setting the interference hints for inregs temporaries.
2016-02-04fix spill bug on return nodesQuentin Carbonneaux
When a node has no successor, its inregs out was initialized with garbage.
2016-01-28cosmeticsQuentin Carbonneaux
2016-01-28fix non-updated limit() call in spillerQuentin Carbonneaux
2016-01-22fix wrong assumption in spill.cQuentin Carbonneaux
2016-01-04fix dopm() in spillQuentin Carbonneaux
2016-01-03change design in spill.cQuentin Carbonneaux
2015-12-27more work on spill, not elegantQuentin Carbonneaux
2015-12-25wip fp lifting in spill.c, pheeewQuentin Carbonneaux
2015-12-23missing case in tmpuse() of spillerQuentin Carbonneaux
2015-11-25add note about comparisons in spillQuentin Carbonneaux
2015-11-20fix spill bug in dopm()Quentin Carbonneaux
2015-11-13this is a buggy shortcut!Quentin Carbonneaux
2015-11-09provide BZERO macro for bitsetsQuentin Carbonneaux
2015-11-03add interference hintsQuentin Carbonneaux
2015-10-30fix two bugs in spillerQuentin Carbonneaux
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-30port spill.c to work with RAMemQuentin Carbonneaux
2015-10-30rename spill field in Tmp to slotQuentin Carbonneaux
2015-10-08rename ealloc to emallocQuentin Carbonneaux
2015-10-06add pool memory managementQuentin Carbonneaux
2015-10-06specialize vdup into idupQuentin Carbonneaux
2015-10-05factor vector duplication in vdup()Quentin Carbonneaux
2015-10-05factor some utility functions/data in util.cQuentin Carbonneaux
2015-10-05clean the command line interfaceQuentin Carbonneaux
2015-09-29wip on new stack slots (emit, spill)Quentin Carbonneaux
2015-09-26move the liveon() function in live.cQuentin Carbonneaux
2015-09-15simplify call handling in spillerQuentin Carbonneaux
2015-09-15heavy modification of call handlingQuentin Carbonneaux
The IR generated by calls was very bulky because two instructions were used for marking the live range of a clobber. This patch attempts to store the information of what registers are use/def/clobber in the call instruction itself, this leads to more compact code (even more when we'll have SSE registers). However, I find that the amount of extra code needed is not really easonable. Fortunately it is not too invasive, thus if the complexity creeps in, it should be easy to revert.
2015-09-15add a size to all operations (wip)Quentin Carbonneaux
2015-09-15make spiller aware of parallel assignmentsQuentin Carbonneaux
2015-09-15fix bug in alignment constraints of spill slotsQuentin Carbonneaux
2015-09-15move spill and emit to the new slot systemQuentin Carbonneaux
In emit, I worked a little to make sure that framesz works when we change the size of the svec array (if we need more alignments).
2015-09-15remove obsolete commentQuentin Carbonneaux
2015-09-15forgot about phi nodes in the spillerQuentin Carbonneaux
When we are dealing with a block that is not a loop, we must make sure to consider phi arguments of successors as live variables. Ideally we could move the code to find all live-ins (including phi arguments) to the live module.
2015-09-15tentative support for fast allocsQuentin Carbonneaux
It seems that the MEM reference type is meaningless in too many positions. Because of this, it is unclear if we should keep it or just introduce a OAddr instruction that only accepts slots. Regardless of the above, the spilling module needs to use the new slot_() function, also, the emit function needs to fetch the size of the stack frame from the slot[] array. The naming is still very transitional, here is a list of all bogus names I can think of: - SLOT() - Tmp.spill - slot_
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-15split store into store{w,l}Quentin Carbonneaux
2015-09-15add nmem to opdesc for use in the spillerQuentin Carbonneaux
This new machine-independent mechanism might not be general enough in the long term but, now, it provides a flexible way to inform the spiller about the maximum number of arguments of an instruction that can be spill locations.
2015-09-15forbid two memory operands for comparisonsQuentin Carbonneaux
2015-09-15fix a bug in setlocQuentin Carbonneaux
The way we detected if limit had spilled a variable was incorrect. This is because two consecutive calls to limit could require a spill of the same variable. Instead, we now use a return value from limit. Note that this is still not so ideal. Indeed, it works properly only when limit spills one value only, if not, we should return a bitset. In the current use scheme of limit, this invariant is true but ideally we would like to call limit with *all arguments added at once*, not one after the other.
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 nreg only when != NRegQuentin Carbonneaux
2015-09-15fix limit bug in spillQuentin Carbonneaux
I think this was not a big issue because the register allocator does not consume a register when it encounters obviously dead code.
2015-09-15start work on comparisonsQuentin Carbonneaux
There are two things I overlooked so far. 1. Binary instructions like cmp that do not have a result in registers need the size suffix sometimes, for example when comparing a spill location with a constant. 2. The register allocator needs to be adapted to support the comparison instruction: it is not possible to compare two spill locations without using a register.