[flang] Use descriptors for real/complex input other than kinds 4 and 8

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, vdonaldson

Differential Revision: https://reviews.llvm.org/D128502

Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
This commit is contained in:
Valentin Clement 2022-06-25 09:18:59 +02:00
parent 4965cea2f3
commit 575eb2133b
No known key found for this signature in database
GPG Key ID: 086D54783C928776
1 changed files with 4 additions and 4 deletions

View File

@ -530,17 +530,17 @@ static mlir::func::FuncOp getInputFunc(mlir::Location loc,
? getIORuntimeFunc<mkIOKey(InputLogical)>(loc, builder)
: getIORuntimeFunc<mkIOKey(InputInteger)>(loc, builder);
if (auto ty = type.dyn_cast<mlir::FloatType>()) {
if (auto width = ty.getWidth(); width <= 32)
if (auto width = ty.getWidth(); width == 32)
return getIORuntimeFunc<mkIOKey(InputReal32)>(loc, builder);
else if (width <= 64)
else if (width == 64)
return getIORuntimeFunc<mkIOKey(InputReal64)>(loc, builder);
}
auto kindMap = fir::getKindMapping(builder.getModule());
if (auto ty = type.dyn_cast<fir::ComplexType>()) {
auto width = kindMap.getRealBitsize(ty.getFKind());
if (width <= 32)
if (width == 32)
return getIORuntimeFunc<mkIOKey(InputComplex32)>(loc, builder);
else if (width <= 64)
else if (width == 64)
return getIORuntimeFunc<mkIOKey(InputComplex64)>(loc, builder);
}
if (type.isa<fir::LogicalType>())