File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
mlir/include/mlir/Dialect/OpenMP Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,37 @@ def OpenMPTaskBasedTarget : Pass<"openmp-task-based-target", "func::FuncOp"> {
16
16
17
17
let constructor = "mlir::createOpenMPTaskBasedTargetPass()";
18
18
19
- let description = [{ First pass attempt}];
19
+ let description = [{
20
+ This pass transforms `omp.target`, `omp.target_enter_data`,
21
+ `omp.target_update_data` and `omp.target_exit_data` whenever these operations
22
+ have the `depend` clause on them.
23
+
24
+ These operations are transformed by enclosing them inside a new `omp.task`
25
+ operation. The `depend` clause related arguments are moved to the new `omp.task`
26
+ operation from the original 'target' operation.
27
+
28
+ Example:
29
+ Input:
30
+ ```mlir
31
+ omp.target map_entries(%map_a -> %arg0, %map_c_from -> %arg1 : memref<?xi32>, memref<?xi32>) depend(taskdependout -> %c : memref<?xi32>) {
32
+ ^bb0(%arg0 : memref<?xi32>, %arg1 : memref<?xi32>) :
33
+ "test.foobar"() : ()->()
34
+ omp.terminator
35
+ }
36
+ ```
37
+ Output:
38
+ ```mlir
39
+ omp.task depend(taskdependout -> %c : memref<?xi32>) {
40
+ omp.target map_entries(%map_a -> %arg0, %map_c_from -> %arg1 : memref<?xi32>, memref<?xi32>) {
41
+ ^bb0(%arg0 : memref<?xi32>, %arg1 : memref<?xi32>) :
42
+ "test.foobar"() : ()->()
43
+ omp.terminator
44
+ }
45
+ }
46
+ ```
47
+ The intent is to make it easier to translate to LLVMIR by avoiding the
48
+ creation of such tasks in the OMPIRBuilder
49
+ }];
20
50
21
51
let dependentDialects = ["omp::OpenMPDialect"];
22
52
}
You can’t perform that action at this time.
0 commit comments