[Mlir-commits] [flang] [mlir] [flang][OpenMP] - Add `MapInfoOp` instances for target private variables when needed (PR #109862)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Sep 30 09:12:10 PDT 2024
================
@@ -0,0 +1,131 @@
+//===- MapsForPrivatizedSymbols.cpp
+//-----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+/// \file
+/// An OpenMP dialect related pass for FIR/HLFIR which creates MapInfoOp
+/// instances for certain privatized symbols.
+/// For example, if an allocatable variable is used in a private clause attached
+/// to a omp.target op, then the allocatable variable's descriptor will be
+/// needed on the device (e.g. GPU). This descriptor needs to be separately
+/// mapped onto the device. This pass creates the necessary omp.map.info ops for
+/// this.
+//===----------------------------------------------------------------------===//
+// TODO:
+// 1. Before adding omp.map.info, check if in case we already have an
+// omp.map.info for the variable in question.
+// 2. Generalize this for more than just omp.target ops.
----------------
agozillon wrote:
The OMPMapInfoFinalization pass tries to generalize a bit to other operations, might be helpful here, although you may require more complicated logic! But of course this is just a suggestion for the future, and can be left for another PR :-)
https://github.com/llvm/llvm-project/pull/109862
More information about the Mlir-commits
mailing list