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

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Sat Jun 25 00:19:44 PDT 2022


Author: Valentin Clement
Date: 2022-06-25T09:19:34+02:00
New Revision: 575eb2133be7a97aae0fb5f70b409a156872eb7d

URL: https://github.com/llvm/llvm-project/commit/575eb2133be7a97aae0fb5f70b409a156872eb7d
DIFF: https://github.com/llvm/llvm-project/commit/575eb2133be7a97aae0fb5f70b409a156872eb7d.diff

LOG: [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 at nvidia.com>

Added: 
    

Modified: 
    flang/lib/Lower/IO.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/IO.cpp b/flang/lib/Lower/IO.cpp
index 8baeafd6ae069..849288b47b24f 100644
--- a/flang/lib/Lower/IO.cpp
+++ b/flang/lib/Lower/IO.cpp
@@ -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>())


        


More information about the flang-commits mailing list