[LLVMdev] Integer promotion of return node operand

Duncan Sands baldrick at free.fr
Tue May 13 23:31:22 PDT 2008


Hi,

> > 1) If C language requires integer promotion of return value argument
> > then should it not be done by the C language frontend. (I think LLVM  
> > is
> > langauge
> > independent). This is what happens when we use char in calculations.
> > Clang promotes char in calculations to int and this promotion is  
> > visible
> > in the disassembly. However return node operand promotion is not  
> > visible
> > in disassembly but LLVM is doing that.
> 
> I think all currently defined calling conventions are "C like". You  
> can add a calling convention and check for it in visitRet.

I agree with the OP that this kind of promotion should be done by the
language front-end.

> > 3) And How should this promotion be handled when the target does not
> > have register to handle int size. e.g. if a target has int size of 16
> > bits but the register size of 8 bits.
> 
> I am not sure how that would work. I'd think you need to have int  
> register class. How does your target handle i16? Can it use register  
> pair?

Presumably this is the same as using i64 on an i32 machine.

Ciao,

Duncan.



More information about the llvm-dev mailing list