[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:
jeanPerier
2024-10-03 17:10:57 +02:00
committed by GitHub
parent a78359c2ed
commit c4204c0b29
148 changed files with 1912 additions and 2028 deletions

View File

@@ -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) &&