[llvm-dev] Legalising seems to lose critical information needed for lowering return values properly?

LLVM Mailing List via llvm-dev llvm-dev at lists.llvm.org
Sun Mar 3 00:19:33 PST 2019


Yes, that sounds like the place for me to look.

Is there any documentation or old notes anywhere or do you think I’m best to just grep the source code for IsSplit and try to copy what ARM does?

Thanks so much Tim!


> On 3 Mar 2019, at 03:08, Tim Northover <t.p.northover at gmail.com> wrote:
> 
> On Sat, 2 Mar 2019 at 06:58, carl-llvm-dev at petosoft.com via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> AVRTargetLowering::LowerFormalArguments, we already have a problem because the 32 bit return value has been turned into two 16 bit values by the legaliser and the information has been lost that it was one 32 bit value.
> 
> Isn't it kept (rather awkwardly) by the fact that the first half of
> this value has the "IsSplit" flag set? The ARM backends use this to
> handle i64 and i128 specially; they need extra alignment rather than
> byte-swapping, but the principle ought to be similar.
> 
>> Which bit of the code do people think is at fault here? What hooks need changing on AVR?
> 
> That's a bit of a tricky question. The way ABIs work on Clang & LLVM
> is unfortunately through a tight coupling between the backend and
> Clang CodeGen. As long as Clang is capable of producing compliant code
> the question of how natural the interface is becomes QoI.
> 
> In this case putting the byte-swapping into Clang would be unnatural
> enough that I lean towards it being a backend issue (maybe with
> generic involvement depending on how the IsSplit thing works out).
> 
> Cheers.
> 
> Tim.



More information about the llvm-dev mailing list