[flang-commits] [flang] [flang][Lower] Add Lowering for CO_{BROADCAST, MAX, MIN, SUM} to PRIF (PR #154770)
Katherine Rasmussen via flang-commits
flang-commits at lists.llvm.org
Sun Aug 24 21:38:05 PDT 2025
================
@@ -3649,6 +3677,86 @@ mlir::Value IntrinsicLibrary::genCmplx(mlir::Type resultType,
imag);
}
+// CO_BROADCAST
+void IntrinsicLibrary::genCoBroadcast(llvm::ArrayRef<fir::ExtendedValue> args) {
+ checkCoarrayEnabled();
+ assert(args.size() == 4);
+ mlir::Value sourceImage = fir::getBase(args[1]);
+ mlir::Value status =
+ isStaticallyAbsent(args[2])
+ ? builder
+ .create<fir::AbsentOp>(loc,
+ builder.getRefType(builder.getI32Type()))
+ .getResult()
+ : fir::getBase(args[2]);
+ mlir::Value errmsg =
+ isStaticallyAbsent(args[3])
+ ? builder.create<fir::AbsentOp>(loc, PRIF_ERRMSG_TYPE).getResult()
----------------
ktras wrote:
Similar to the comment on PR #154166, I believe that because of the future deprecation of `builder.create`, it would be better to change calls like the one on this line to `fir::AbsentOp::create`.
https://github.com/llvm/llvm-project/pull/154770
More information about the flang-commits
mailing list