[llvm-commits] [PATCH] Bug in APCS

Eric Christopher echristo at apple.com
Tue Oct 12 13:51:30 PDT 2010


On Oct 12, 2010, at 1:07 PM, Chris Lattner wrote:

> 
> On Oct 12, 2010, at 12:33 PM, Eric Christopher wrote:
> 
>>>> Since it's greater than 128-bits I think the abi says to pass it by reference and return in memory?
>>>> 
>>>> ...
>>>> A 128-bit containerized vector is returned in r0-r3.
>>>> ...
>>>> A Composite Type larger than 4 bytes, or whose size cannot be determined statically by both caller and callee, is stored in memory at an address passed as an extra argument when the function was called (ยง5.5, rule A.4).
>>> 
>>> Typically that would be handled by the frontend, not in the code generator.  If a <3 x double> makes it into LLVM IR, the code generator can do whatever it wants. Similar things happen on X86 etc.
>> 
>> Sure, but what do you think should happen with the return value? Seems like whatever generated the arg passing in the first place should have done the right thing?
> 
> I'm not sure what you mean.  The code generator shouldn't crash on IR that returns a <3 x double>.  Codegen should do something sensible even though it isn't constrained to match a specific ABI.

Sure, I'd prefer it raise an error if it's a type that it can't handle conformantly rather than generate code that's unexpected.

-eric



More information about the llvm-commits mailing list