[Mlir-commits] [mlir] [MLIR][OpenMP] Add OMP Declare Mapper MLIR Op definition (PR #117045)
Sergio Afonso
llvmlistbot at llvm.org
Mon Feb 10 03:21:48 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:
I think we should add a region verifier to `DeclareMapperOp` (i.e. `let hasRegionVerifier = 1` and define `DeclareMapperOp::verifyRegions()`) to check that the last operation in its only block is a `DeclareMapperInfoOp`. Also, I'd suggest adding an `extraClassDeclaration` `DeclareMapperInfoOp DeclareMapperOp::getDeclareMapperInfo()` or similar, so that this op-specific logic doesn't have to be replicated by all users, but rather stay contained in the operation itself.
https://github.com/llvm/llvm-project/pull/117045
More information about the Mlir-commits
mailing list