How to construct DenseElementsAttr with custom float type?

Hello!

When adding a custom dialect type to model a specific float element type I’m running into problems with splat constants… specifically, construction of DenseElementsAttr::get(myShapedType, values) for initialization of the constant value fails with llvm-project/mlir/lib/IR/Types.cpp: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion isIntOrFloat() && "only integers and floats have a bitwidth"' failed. AFAIU these are methods on the builtin FloatType class which cannot be overridden…

I’ve seen this problem mentioned before here, but I don’t think this was ever resolved (though it’s entirely possible I missed it).

How do people typically get around this?