Alexander Monakov wrote:
Hi.

I have two questions related to register allocation and reload area.

1. Is there a way to distinguish memory accesses introduced during register allocation (register spills and fills) from "regular" ones? Or, alternatively, is augmenting reload & friends to use specific instructions to perform spill&fill possible? I'm asking because on ia64 one must use special instructions to read/write registers that originate from control-speculative load (in case speculation was unsuccessful, such registers will have an attribute, called NaT bit, set, and it must be saved and restored properly when such register is spilled), so currently GCC cannot perform control speculation before register allocation on ia64.

You can differ spill slots from other stack memory. All spill slots are generated in reload1::alter_reg. It is called at the start of reload1::reload for pseudo-registers got memory (their reg_renumber is negative) and during reload work when the reload needs a hard register and has to spill a pseudo-register assigned to the hard register during local/global alloc. This pseudo-register is spilled and getting memory from alter_reg. In the last case, a simple sharing stack slots has been implemented (based on a hard-register assigned to the pseudo before spilling).
2. Is there a way to ask register allocator to allocate same hard regs for given pseudo in given pair of insns? I assume the answer is 'no', but just in case :) Again, this is needed to support data speculation before register allocation: register that is speculatively loaded must be same for speculative load and check.
Currently the same pseudo-register always get the same hard-register (or memory). The current register allocator does not support register live range splitting.

Reply via email to