[llvm] r221948 - First stage of call lowering for Mips fast-isel
Eric Christopher
echristo at gmail.com
Fri Nov 14 13:19:10 PST 2014
On Thu Nov 13 2014 at 5:36:40 PM Reid Kleckner <rnk at google.com> wrote:
> On Thu, Nov 13, 2014 at 5:24 PM, reed kotler <rkotler at mips.com> wrote:
>
>> On 11/13/2014 05:20 PM, Reid Kleckner wrote:
>>
>> Looks like you're including that .inc file twice, which is going to
>> duplicate the code. IMO it'd be better to call over from FastISel into a
>> wrapper in ISelLowering if you want to use these.
>>
>> I think it's a mistake for tablegen to be generating static functions
>> here.
>>
>> Why should I have to make a wrapper?
>>
>> I've raised this issue before but did not get any response.
>>
>
> Wow. Looks like all the other backends duplicate this code:
>
> $ git grep '#include.*GenCallingConv.inc' ../lib/Target/
> ../lib/Target/AArch64/AArch64FastISel.cpp:#include
> "AArch64GenCallingConv.inc"
> ../lib/Target/AArch64/AArch64ISelLowering.cpp:#include
> "AArch64GenCallingConv.inc"
> ../lib/Target/ARM/ARMFastISel.cpp:#include "ARMGenCallingConv.inc"
> ../lib/Target/ARM/ARMISelLowering.cpp:#include "ARMGenCallingConv.inc"
> ../lib/Target/MSP430/MSP430ISelLowering.cpp:#include
> "MSP430GenCallingConv.inc"
> ../lib/Target/Mips/MipsFastISel.cpp:#include "MipsGenCallingConv.inc"
> ../lib/Target/Mips/MipsISelLowering.cpp:#include "MipsGenCallingConv.inc"
> ../lib/Target/PowerPC/PPCFastISel.cpp:#include "PPCGenCallingConv.inc"
> ../lib/Target/PowerPC/PPCISelLowering.cpp:#include "PPCGenCallingConv.inc"
> ../lib/Target/R600/AMDGPUISelLowering.cpp:#include
> "AMDGPUGenCallingConv.inc"
> ../lib/Target/Sparc/SparcISelLowering.cpp:#include
> "SparcGenCallingConv.inc"
> ../lib/Target/SystemZ/SystemZISelLowering.cpp:#include
> "SystemZGenCallingConv.inc"
> ../lib/Target/X86/X86FastISel.cpp:#include "X86GenCallingConv.inc"
> ../lib/Target/X86/X86ISelLowering.cpp:#include "X86GenCallingConv.inc"
> ../lib/Target/XCore/XCoreISelLowering.cpp:#include
> "XCoreGenCallingConv.inc"
>
> This seems less than ideal. Eric, should we really be doing that?
>
Ideally no. I mean, we could generate separate CC.inc files for fast-isel?
A wrapper seems reasonable as well, but seems like a shame we can't
generate the right stuff out of it.
Perhaps the best solution is taking the calling convention bits from being
a bunch of static functions in a namespace and encapsulating them into a
class in a header that can be extended by the target. I.e. giving it a
wrapper by default?
That's probably what I'd do.
-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141114/f61d2397/attachment.html>
More information about the llvm-commits
mailing list