[LLVMdev] Register allocation in two passes

Borja Ferrer borja.ferav at gmail.com
Tue Nov 29 10:24:16 PST 2011


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.

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).
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.

I've also added Jakob (i hope he doesn't mind :) ) to this thread so he can
give his point of view.

Thanks for the reply Andy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111129/a605c286/attachment.html>


More information about the llvm-dev mailing list