[LLVMdev] TargetLowering::isIntImmLegal(...)

reed kotler rkotler at mips.com
Tue Mar 5 18:31:48 PST 2013

The thing I wanted for mips 16 for large literals does not seem to exist 
right now.

They have MipsTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT)

but not the same thing for integer literals.

For Mips16, to materialize a 32 bit literal using instructions is 
expensive, both in terms of the number of registers and the number of 

You always want to just do a load of the constant from the local text 
section using a PC relative load.

I could try and add this to the target independent section if there 
seems to be interest in this.

I might first prototype in the Mips target area.


More information about the llvm-dev mailing list