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

Bevin Hansson via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 7 08:18:57 PST 2019


Hi,

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.

Just my two cents; I believe that 'IsSplit' is not actually set on return values in certain cases. Found this out when I was looking into a similar calling convention detail in our downstream target.

Also, this might not be relevant to this particular case, but IsSplit is a bit of a kludge and generally useless if you're splitting something into more than two parts, since it cannot tell you which sub-value you're actually looking at. It only tells you that it _is_ a sub-value (and if it's the last one), which makes picking registers in some particular order quite difficult. This means you need to keep state in your CC analyzer, or preanalyze the arguments.

/ Bevin
_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190307/2e4b0953/attachment-0001.html>


More information about the llvm-dev mailing list