[LLVMdev] Troubling promotion of return value to Integer ...

Evan Cheng evan.cheng at apple.com
Fri May 16 16:12:31 PDT 2008


It could be. That would be one way to fix (at least part of the fix) it.

Evan

On May 16, 2008, at 3:00 PM, Duncan Sands wrote:

>>>> If you are using a non-C ABI, then you may not need to do the
>>>> promotion at all. However, if you do need to do the promotion, you
>>>> need to know the type of "int".
>>>
>>> how does this work for parameters.  Suppose I have an i1 parameter.
>>> The AMD64 ABI says it is passed in one of %rsi, %rdx, %rcx, %r8 and
>>> %r9 registers.  In the case of _Bool (i1) it says that the upper 63
>>> bits will be zero.  How does this work?  I thought i1 would be
>>> legalized
>>> to i8 (which is legal, right?).  Due to being marked zext, the upper
>>> 7 bits of the i8 will be zero.  But where does it get extended to
>>> an i64 with upper 63 bits zero?
>>
>> X86ISelLowering will promote the i8 parameters to i32.
>
> OK, so why doesn't it work the same for return values?
>
> Ciao,
>
> Duncan.




More information about the llvm-dev mailing list