Removing the constant pool

Hi all,

I was wondering if it is possible to stop floating-point constants being converted to use the constant pool? As for our back-end we would like to be able to treat floating point constants the same way integer constants are treated instead of having to go via the constant pool.

Thanks for your help,

Rob

Hello

I was wondering if it is possible to stop floating-point constants being converted to use the constant pool? As for our back-end we would like to be able to treat floating point constants the same way integer constants are treated instead of having to go via the constant pool.

Yes, surely. Just make ISD::ConstantFP for given type legal and handle
it during isel.

Is that really sufficient? See X86ISelLowering.cpp, look for addLegalFPImmediate. Usually targets have to tell legalizer what fp immediates are legl.

Evan

Hello, Evan

Is that really sufficient? See X86ISelLowering.cpp, look for addLegalFPImmediate. Usually targets have to tell legalizer what fp immediates are legl.

Right, because ConstantFPs are normally "Expand". These tells the
codegen that "only some are legal". At least this was how I deduced
from the code :slight_smile: