Yes, I want the register to be allocatable when there are no stack frames used in the function so it can be used for other purposes. In fact, I looked at how other backends solve this problem, but they are all too conservative by always reserving the register which in my case it is not a good solution because of the performance impact of not having this register available.<br>
<br>I find very interesting what you mentioned of tying the physical reg to spill code. I've created a pseudo instruction for spill code and i've tied this physical reg as one of its operands (this register is sort of a shadow reg of the stack pointer where it can be used as a normal reg when there's no stack manipulation in the function or as the SP when regs are spilled).<br>
Then if I understood correctly the second part is making the regalloc aware of this so it can evict other live ranges using this register to avoid the conflict of both using this register freely and in the spill code which is what is happening to me, however I'm not very confident with myself on touching the regalloc.<br>
<br>I've also added Jakob (i hope he doesn't mind :) ) to this thread so he can give his point of view.<br><br>Thanks for the reply Andy.<br><br>