[flang-commits] [flang] [flang] replace fir.complex usages with mlir complex (PR #110850)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Thu Oct 3 04:14:37 PDT 2024
================
@@ -1462,13 +1436,13 @@ class FunctionDistance {
static unsigned getFloatingPointWidth(mlir::Type t) {
if (auto f{mlir::dyn_cast<mlir::FloatType>(t)})
return f.getWidth();
+ if (auto cplx{mlir::dyn_cast<mlir::ComplexType>(t)})
+ return mlir::cast<mlir::FloatType>(cplx.getElementType()).getWidth();
// FIXME: Get width another way for fir.real/complex
// - use fir/KindMapping.h and llvm::Type
// - or use evaluate/type.h
if (auto r{mlir::dyn_cast<fir::RealType>(t)})
return r.getFKind() * 4;
----------------
tblah wrote:
nit: Can you remove this comment and fir::RealType support now?
https://github.com/llvm/llvm-project/pull/110850
More information about the flang-commits
mailing list