[LLVMdev] Custom lowering DYNAMIC_STACKALLOC

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Jun 21 07:20:52 PDT 2011


On Jun 17, 2011, at 7:31 AM, Sanjoy Das wrote:

> c. Having EmitLoweredSegAlloca do the checks, (calling the external
> function if needed) and, in both the cases, write the pointer to the
> allocated memory to RAX. If the function is called nothing extra needs
> to be done, since the return value stays at RAX. If the stack pointer
> was changed, I do a (X86::MOV64rr, X86::RAX).addReg(X86::RSP).

Try not to use physical registers before register allocation unless you absolutely have to.

If you call a function, immediately copy the return value to a virtual register. Same thing for the stack pointer; copy it to a virtual register (using COPY, not MOV64rr).

You'll probably need a PHI as well.

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110621/9aa942f5/attachment.html>


More information about the llvm-dev mailing list