[LLVMdev] Calling-convention lowering proposal

Dan Gohman gohman at apple.com
Sun Apr 26 17:37:49 PDT 2009


On Apr 24, 2009, at 10:27 AM, Sanjiv Gupta wrote:

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

Thanks for the testing and the testcases.  PIC16 is certainly the most
complicated of the bunch :-}.  I have fixes for each of these, and with
them I've verified that a patched llc is emitting the same output as an
unpatched llc, with one exception which I believe is ok.  I'll post
details and an updated patch soon.

Dan




More information about the llvm-dev mailing list