Liad Mordekoviz via llvm-dev
2018-Aug-08 12:28 UTC
[llvm-dev] Passing arguments to var args function
Hey, I am working on a new back-end, in my back end, I require to pass every argument through a register when calling a function, unless the argument is part of the ellipsis (...) and then pass it through the stack, I've tried creating a CCCustom function to analyze the operands when a function has var args, however, the information whether the out val is fixed or not is not passed into the analyze function, the code I'm talking about can be seen here: https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/CallingConvLower.cpp#L138 In line 144 the Fn is called, the Outs[i] contains the information required for such thing because it contains the IsFixed flag. Did anyone else come by such requirement? is there any other way anyone could recommend handling such requirement? Thanks in advance, Liad. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180808/c88648cb/attachment.html>
Tim Northover via llvm-dev
2018-Aug-08 13:21 UTC
[llvm-dev] Passing arguments to var args function
Hi Liad, On Wed, 8 Aug 2018 at 13:28, Liad Mordekoviz via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Did anyone else come by such requirement? is there any other way anyone could recommend handling such requirement?Apple's calling convention on iOS does this. We have two separate CC_Whatever definitions and then AArch64ISelLowering.cpp chooses which one to use based on whether the argument is fixed or not (see line 3446 onwards). Cheers. Tim.
Liad Mordekoviz via llvm-dev
2018-Aug-08 13:42 UTC
[llvm-dev] Passing arguments to var args function
Hey Tim, thanks for the quick answer, this looks exactly like what I was trying to achieve, I was hoping there was something more clean, I was wondering how the community would accept a change in the TD, if the code at CallinvConvLower.cpp:138 would've passed the IsFixed flag to the AssignFn then all those workarounds wouldn't be needed, this example is only one of a few I can think of for expanding the CallingConvention tablegen capabilities regarding this issue. Thanks for the answer. On Wed, Aug 8, 2018 at 4:21 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Liad, > > On Wed, 8 Aug 2018 at 13:28, Liad Mordekoviz via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Did anyone else come by such requirement? is there any other way anyone > could recommend handling such requirement? > > Apple's calling convention on iOS does this. We have two separate > CC_Whatever definitions and then AArch64ISelLowering.cpp chooses which > one to use based on whether the argument is fixed or not (see line > 3446 onwards). > > Cheers. > > Tim. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180808/11c30251/attachment.html>