diff --git a/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp b/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp --- a/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp +++ b/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp @@ -181,7 +181,12 @@ return IntegerType::get(&getContext(), type.getWidth()); } -Type LLVMTypeConverter::convertFloatType(FloatType type) { return type; } +Type LLVMTypeConverter::convertFloatType(FloatType type) { + // TODO: Do not convert `f8` types to `i8` once LLVM will fully support them. + if (type.isFloat8E4M3FN() || type.isFloat8E5M2()) + return IntegerType::get(type.getContext(), 8); + return type; +} // Convert a `ComplexType` to an LLVM type. The result is a complex number // struct with entries for the