[LLVMdev] Calling-convention lowering proposal

Sanjiv Gupta sanjiv.gupta at microchip.com
Fri Apr 24 10:27:38 PDT 2009

Dan Gohman wrote:
> Hello,
> Attached is a patch which significantly reworks how calls, incoming
> arguments, and outgoing return values are lowered. It's a major change,
> affecting all targets, so I'm looking for feedback on the approach.
> The goal of the patch is to eliminate a bunch of awkward code,
> eliminate some unnecessary differences between targets, and to
> facilitate future refactoring and feature work.
> This patch gets rid of ISD::CALL, ISD::FORMAL_ARGUMENTS, ISD::RET, and
> ISD::ISD::ARG_FLAGS, as well as the old LowerArguments and LowerCallTo
> hooks. To replace them, it adds three new TargetLowering hooks:
> LowerCall, LowerFormalArguments, and LowerReturn. These hooks provide
> targets with the same information as the special nodes, except in an
> immediately usable form instead of awkwardly encoded as SDNode
> operands. The patch also re-works a substantial portion of the
> target-independent tail-call code. The patch also includes changes
> for all in-tree targets to use the new hooks.
> Beyond dejagnu and some manual assembly output inspection,
> so far I've only tested this on x86 targets. I'm not in a hurry
> with this; I'm just looking for input at this point.
> Dan
Hi Dan,
I quickly ran my tests with your changes and a few of them breaks llc 
while a few other have incorrect assembly. I am attaching the .bc files 
here. The llc options I use --pre-RA-sched=list-burr and -regalloc=pbqp

fun_in_expr3.bc  (llc breaks)
struct_args_5.bc (incorrect assemly, execution fails)
char_char.bc (llc breaks)

I haven't really examined what is the reason of failures. Will do so as 
soon as I get some time off from rest of the stuff. Let me know if you 
need any specific inputs on pic16 port.

- Sanjiv
> ------------------------------------------------------------------------
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fun_in_expr3.bc
Type: application/octet-stream
Size: 604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090424/dfae698f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: struct_args_5.bc
Type: application/octet-stream
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090424/dfae698f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: char_char.bc
Type: application/octet-stream
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090424/dfae698f/attachment-0002.obj>

More information about the llvm-dev mailing list