Hello, <br><br>I'm having a curious design conflict related to reserving registers before the register allocator pass is executed with the backend I'm writing. Basically, what I need is to reserve a certain register only if frame space is allocated in the stack, more precisely I'm interested in the case where a register spill occurs.<br>
In order to know if a register is spilled the register allocator has to be executed so i can reserve this special reg, but since the register reservation occurs before the allocator is executed there's no way to get this info in only a single pass.<br>
The only solution i can think of is running the regalloc twice, first to see if any regs are spilled without performing any changes and a second one for doing the real allocation. As a test I've managed to do this with the Greedy regalloc by making the first regalloc execution to not perform a virtreg rewrite at the end of the function pass. But i really want to know if this is safe and if there's a better way of doing it.<br>
<br>Thanks for any suggestions<br><br>