[flang] replace fir.complex usages with mlir complex (#110850)
Core patch of https://discourse.llvm.org/t/rfc-flang-replace-usages-of-fir-complex-by-mlir-complex-type/82292. After that, the last step is to remove fir.complex from FIR types.
This commit is contained in:
@@ -417,10 +417,7 @@ mlir::Value fir::FirOpBuilder::convertWithSemantics(
|
||||
// imaginary part is zero
|
||||
auto eleTy = helper.getComplexPartType(toTy);
|
||||
auto cast = createConvert(loc, eleTy, val);
|
||||
llvm::APFloat zero{kindMap.getFloatSemantics(
|
||||
mlir::cast<fir::ComplexType>(toTy).getFKind()),
|
||||
0};
|
||||
auto imag = createRealConstant(loc, eleTy, zero);
|
||||
auto imag = createRealZeroConstant(loc, eleTy);
|
||||
return helper.createComplex(toTy, cast, imag);
|
||||
}
|
||||
if (fir::isa_complex(fromTy) &&
|
||||
|
||||
Reference in New Issue
Block a user