[flang-commits] [flang] [flang] Add support of THIS_IMAGE and NUM_IMAGES with PRIF (PR #154081)
Valentin Clement バレンタイン クレメン via flang-commits
flang-commits at lists.llvm.org
Mon Aug 18 09:59:22 PDT 2025
================
@@ -8327,6 +8352,28 @@ mlir::Value IntrinsicLibrary::genThisGrid(mlir::Type resultType,
return res;
}
+// THIS_IMAGE
+fir::ExtendedValue
+IntrinsicLibrary::genThisImage(mlir::Type resultType,
+ llvm::ArrayRef<fir::ExtendedValue> args) {
+ checkCoarrayEnabled();
+ assert(args.size() >= 1 && args.size() <= 3);
+ const bool coarrayIsAbsent = args.size() == 1;
+ mlir::Value team =
+ !isStaticallyAbsent(args, args.size() - 1)
+ ? fir::getBase(args[args.size() - 1])
+ : builder
+ .create<fir::AbsentOp>(loc,
+ fir::BoxType::get(builder.getNoneType()))
+ .getResult();
+
+ if (!coarrayIsAbsent) {
+ TODO(loc, "this_image with coarray argument.");
+ }
----------------
clementval wrote:
No braces
https://github.com/llvm/llvm-project/pull/154081
More information about the flang-commits
mailing list