================
@@ -1304,18 +1304,10 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const
APValue &value,
return cir::IntAttr::get(ty, value.getInt());
}
case APValue::Float: {
- const llvm::APFloat &init = value.getFloat();
- if (&init.getSemantics() == &llvm::APFloat::IEEEhalf() &&
- !cgm.getASTContext().getLangOpts().NativeHalfType &&
- cgm.getASTContext().getTargetInfo().useFP16ConversionIntrinsics()) {
- cgm.errorNYI("ConstExprEmitter::tryEmitPrivate half");
- return {};
- }
-
mlir::Type ty = cgm.convertType(destType);
assert(mlir::isa<cir::FPTypeInterface>(ty) &&
"expected floating-point type");
- return cir::FPAttr::get(ty, init);
+ return cir::FPAttr::get(ty, value.getFloat());
----------------
erichkeane wrote:
If you see, the previous behavior was NYI, which is why it isn't tested. But
by removing NYI, you're making a bit of a guarantee that we're handling this
right. So getting spot-checks for these is pretty important.
https://github.com/llvm/llvm-project/pull/207212
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits