[flang-commits] [flang] [Flang] Add a HLFIR Minloc intrinsic (PR #74436)

via flang-commits flang-commits at lists.llvm.org
Tue Dec 5 02:04:33 PST 2023


================
@@ -201,6 +201,19 @@ class HlfirReductionIntrinsicConversion : public HlfirIntrinsicConversion<OP> {
     return lowerArguments(operation, inArgs, rewriter, argLowering);
   };
 
+  auto buildMinMaxLocArgs(OP operation, mlir::Type i32, mlir::Type logicalType,
+                          mlir::PatternRewriter &rewriter,
+                          std::string opName) const {
+    llvm::SmallVector<IntrinsicArgument, 3> inArgs;
+    inArgs.push_back({operation.getArray(), operation.getArray().getType()});
+    inArgs.push_back({operation.getDim(), i32});
+    inArgs.push_back({operation.getMask(), logicalType});
+    inArgs.push_back({operation.getKind(), i32});
----------------
jeanPerier wrote:

I think the KIND should be reconstructed from the integer result type here.

https://github.com/llvm/llvm-project/pull/74436


More information about the flang-commits mailing list