Does anyone have any thoughts on relaxing the type constraints for a FloatAttr to allow it to use LLVM::LLVMType types (that correspond to floating point) as well as the standard FloatType?
There is a quirk in an LLVM::ConstantOp in that it takes an Attribute for its value. That Attribute, in our case, is a FloatAttr with a FloatType, even though we are trying to emit an LLVM constant with a FP semantics distinct from the standard dialect supported ones.
An alternative approach might be to teach the LLVM IR dialect converter to call out to our code when it finds a custom dialect attribute rather than a standard attribute.
Adding more description:
X is an LLVM::ConstantOp containing: attribute A which is a FloatAttr containing: value V which is an APFloat with semantics double-double type FT which is a (standard) FloatType of <no standard FloatType for double-double>
So this is not quite ok in some ways, but fails various type checks for obvious reasons.