Jon Chesterfield via llvm-dev
2017-Aug-10 18:52 UTC
[llvm-dev] Custom call lowering - where?
Thanks! It was the ARM back end which alerted me to the possibility of doing this. It's great to have confirmation that generating conversion code within the call lowering is considered reasonable. It appears that CallingConv.td is used to declare what the lowering code will do and the function lowering is the place to actually do it. The CCCustom API certainly makes more sense with the example. Cheers On Thu, Aug 10, 2017 at 7:38 PM, Friedman, Eli <efriedma at codeaurora.org> wrote:> On 8/10/2017 1:49 AM, Jon Chesterfield via llvm-dev wrote: > >> The CallingConv.td file can specify CCCustom and ISelLowering has >> LowerFormalArguments. The existing uses of CCCustom pick a register to pass >> an unmodified argument in and LowerFormalArguments is mostly concerned with >> marking registers as live, though I think provides enough information that >> I can munge the DAG there. >> >> I would like to pass a scalar type (marked as a register class) in a >> vector register. I essentially want to wrap the argument in a >> SCALAR_TO_VECTOR ISD node before calling a function and unwrap it using >> EXTRACT_VECTOR_ELT or similar within the function. >> >> Where should I introduce these additional nodes, or should it be possible >> to achieve this via CCCustom? >> > > See RetCC_ARM_APCS_Custom_f64/ARMTargetLowering::LowerCallResult for an > straightforward example of how CCCustom works in practice. You can > generate whatever conversion code you need in your call lowering code. > > -Eli > > -- > Employee of Qualcomm Innovation Center, Inc. > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux > Foundation Collaborative Project > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170810/5c1a825a/attachment.html>