[Mlir-commits] [mlir] [MLIR][OpenMP] Add OMP Declare Mapper MLIR Op definition (PR #117045)
Sergio Afonso
llvmlistbot at llvm.org
Fri Feb 7 05:04:31 PST 2025
================
@@ -879,6 +879,15 @@ cleanup {
omp.yield
}
+// CHECK: omp.declare_mapper @my_mapper : !llvm.struct<"my_type", (i32)>
+omp.declare_mapper @my_mapper : !llvm.struct<"my_type", (i32)> {
+^bb0(%arg: !llvm.ptr):
+ // CHECK: %[[DECL_MAP_INFO:.*]] = omp.map.info var_ptr(%{{.*}} : !llvm.ptr, !llvm.struct<"my_type", (i32)>) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+ %decl_map_info = omp.map.info var_ptr(%arg : !llvm.ptr, !llvm.struct<"my_type", (i32)>) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
+ // CHECK: omp.declare_mapper_info map_entries(%[[DECL_MAP_INFO]] : !llvm.ptr)
+ omp.declare_mapper_info map_entries(%decl_map_info : !llvm.ptr)
----------------
skatrak wrote:
What is your plan for finding this operation during MLIR to LLVM IR translation?
What I'm wondering is whether the plan is to allow multiple exit points from the region (e.g. multiple blocks terminated with `omp.declare_mapper.info` operations), and evaluate this at runtime, or whether we want to restrict the region to be able to find this operation statically.
To that end, the operation could always contain a single block (i.e. add the `SingleBlock` trait) or have some logic in the verifier to make sure we have a single exit block containing this terminator reachable from all paths starting at the entry block.
https://github.com/llvm/llvm-project/pull/117045
More information about the Mlir-commits
mailing list