[llvm-commits] [PATCH] Bug in APCS

Tanya Lattner lattner at apple.com
Tue Oct 12 14:11:00 PDT 2010


On Oct 12, 2010, at 2:07 PM, Bob Wilson wrote:

> 
> On Oct 12, 2010, at 12:14 PM, Tanya Lattner wrote:
> 
>> 
>> Hello,
>> 
>> I discovered a bug in APCS when returning a vector of size 3 and type double. It hits llvm_unreachable because it runs out of registers to use when attempting to return the double3 via the calling convention APCS. 
>> 
>> Attached is a patch with my suggested changes and a test case. I'd appreciate a review of this patch.
> 
> The patch looks fine, but it is strange to handle only <3 x double> and not, for example, <4 x double>.  We can do whatever we want here since the ABI says <3 x double> should be returned in memory, but I don't like this very much.  I agree with Chris that it would be good for codegen to do something sane in this case, but I'm not really sure what that should be.  If the frontend didn't provide an sret argument, with stack space in the caller, we can't even return the value in memory, can we?
> 

Yes, it will do the same thing for any double vector of size greater than 3. It would be better if the code generator didn't hit the llvm_unreachable, but at what size do we draw the line? I'm not sure. 

-Tanya






More information about the llvm-commits mailing list