[LLVMdev] promotion of return value.

Cédric Venet
Fri, 13 Mar 2009 20:53:46 -0000

Rafael Espindola a écrit :
> My proposal is to make the extension as explicit as possible. If the
> callee is extending an char to an int, the generated llvm code should
> return an i32 and the caller can assume that the extension has been done.
>
> Are you saying that the decision to do the extension in the callee happens
> after we have generated llvm? That is, an optimization is transforming
> a function that would return an i8 into one that returns i16 or i32?
>
> Do you have a testcase for the problem you are trying to solve?
>

I think the problem was that some target don't support i32 natively (in
hadware) like for exemple the PIC16. To force an extension to i32 is
expensive on these target and may pose ABI compatibility problems.

Anyways, i32 on 64 bits targets may be inefficient, so solving the
problem in a more general way is better. Impossing i32 as *the* default
size used by everyone is wrong.

just my 2cents

Cédric