[Mlir-commits] [flang] [mlir] [mlir][OpenMP] - MLIR to LLVMIR translation support for delayed privatization of allocatables in `omp.target` ops (PR #113208)

Tom Eccles llvmlistbot at llvm.org
Mon Oct 28 03:59:47 PDT 2024


================
@@ -3316,19 +3316,25 @@ createDeviceArgumentAccessor(MapInfoData &mapData, llvm::Argument &arg,
 
   return builder.saveIP();
 }
-static bool privatizerNeedsMap(omp::PrivateClauseOp &privatizer) {
-  Region &allocRegion = privatizer.getAllocRegion();
-  Value blockArg0 = allocRegion.getArgument(0);
-  return !blockArg0.use_empty();
-}
-
-// Return the llvm::Value * corresponding to the privateVar that
-// is being privatized. It isn't always as simple as looking up
-// moduleTranslation with privateVar. For instance, in case of
-// an allocatable, the descriptor for the allocatable is privatized.
-// This descriptor is mapped using an MapInfoOp. So, this function
-// will return a pointer to the llvm::Value corresponding to the
-// block argument for the mapped descriptor.
+/// privatizer is a PrivateClauseOp that privatizes an MLIR value.
+/// privatizerNeedsMap returns true if the value being privatized in an
+/// omp.target p should additionally be mapped to the target region
+/// using a MapInfoOp. This is most common when an allocatable is privatized.
+/// In such cases, the descriptor is use in privatization and needs to be
+/// mapped on to the device.
+// static bool privatizerNeedsMap(omp::PrivateClauseOp &privatizer) {
+//   Region &allocRegion = privatizer.getAllocRegion();
+//   Value blockArg0 = allocRegion.getArgument(0);
+//   return !blockArg0.use_empty();
+// }
----------------
tblah wrote:

nit

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


More information about the Mlir-commits mailing list