[llvm] r279341 - GlobalISel: support legalization of G_FCONSTANTs

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 16:11:02 PDT 2016


> Why bother having a separate constant type for FP? In AMDGPU and AArch64, isel bitcasts all FP constants into integer immediates and uses the bitvalues. Is there any value into keeping fpimm around?

I did consider this, but decided on a separate version mostly for debugability. It's a lot easier to work out what "G_FCONSTANT s64 double 42.5" is when things go wrong than "G_CONSTANT s64 4631178160564600832".

We're going to need some kind of MIR querying interface anyway I think (and fairly soon), so that we can reason about chains of use/defs. At that point we could probably put a "getFPConstant" function in and merge them back again without sacrificing much.

Tim.


More information about the llvm-commits mailing list