[Mlir-commits] [mlir] [flang][OpenMP] Translate OpenMP scopes when compiling for target device (PR #130078)

Sergio Afonso llvmlistbot at llvm.org
Mon Mar 10 06:46:46 PDT 2025


================
@@ -5236,6 +5242,28 @@ convertTargetDeviceOp(Operation *op, llvm::IRBuilderBase &builder,
   return convertHostOrTargetOperation(op, builder, moduleTranslation);
 }
 
+/// Forwards private entry block arguments, \see forwardArgs for more details.
+template <typename OMPOp>
+static void forwardPrivateArgs(OMPOp ompOp,
+                               LLVM::ModuleTranslation &moduleTranslation) {
+  auto blockArgIface = cast<omp::BlockArgOpenMPOpInterface>(*ompOp);
+  if (blockArgIface) {
----------------
skatrak wrote:

Nit: No need to check `blockArgIface`, since `cast` already asserts it holds a value of the right type. Same in the function below.

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


More information about the Mlir-commits mailing list