3
3
// CHECK-LABEL: @omp_target_depend
4
4
// CHECK-SAME: (%arg0: memref<i32>, %arg1: memref<i32>) {
5
5
func.func @omp_target_depend (%arg0: memref <i32 >, %arg1: memref <i32 >) {
6
- // CHECK: omp.task depend(taskdependin -> %arg0 : memref<i32>, taskdependin -> %arg1 : memref<i32>, taskdependinout -> %arg0 : memref<i32>) {
6
+ // CHECK: omp.task if(%false) depend(taskdependin -> %arg0 : memref<i32>, taskdependin -> %arg1 : memref<i32>, taskdependinout -> %arg0 : memref<i32>) {
7
7
// CHECK: omp.target {
8
8
omp.target depend (taskdependin -> %arg0 : memref <i32 >, taskdependin -> %arg1 : memref <i32 >, taskdependinout -> %arg0 : memref <i32 >) {
9
9
// CHECK: omp.terminator
@@ -14,12 +14,12 @@ func.func @omp_target_depend(%arg0: memref<i32>, %arg1: memref<i32>) {
14
14
// CHECK-LABEL: func @omp_target_enter_update_exit_data_depend
15
15
// CHECK-SAME:([[ARG0:%.*]]: memref<?xi32>, [[ARG1:%.*]]: memref<?xi32>, [[ARG2:%.*]]: memref<?xi32>) {
16
16
func.func @omp_target_enter_update_exit_data_depend (%a: memref <?xi32 >, %b: memref <?xi32 >, %c: memref <?xi32 >) {
17
- // CHECK-NEXT : [[MAP0:%.*]] = omp.map_info
18
- // CHECK-NEXT: [[MAP1:%.*]] = omp.map_info
19
- // CHECK-NEXT: [[MAP2:%.*]] = omp.map_info
20
- %map_a = omp.map_info var_ptr (%a: memref <?xi32 >, tensor <?xi32 >) map_clauses (to ) capture (ByRef ) -> memref <?xi32 >
21
- %map_b = omp.map_info var_ptr (%b: memref <?xi32 >, tensor <?xi32 >) map_clauses (from ) capture (ByRef ) -> memref <?xi32 >
22
- %map_c = omp.map_info var_ptr (%c: memref <?xi32 >, tensor <?xi32 >) map_clauses (exit_release_or_enter_alloc ) capture (ByRef ) -> memref <?xi32 >
17
+ // CHECK: [[MAP0:%.*]] = omp.map.info
18
+ // CHECK-NEXT: [[MAP1:%.*]] = omp.map.info
19
+ // CHECK-NEXT: [[MAP2:%.*]] = omp.map.info
20
+ %map_a = omp.map.info var_ptr (%a: memref <?xi32 >, tensor <?xi32 >) map_clauses (to ) capture (ByRef ) -> memref <?xi32 >
21
+ %map_b = omp.map.info var_ptr (%b: memref <?xi32 >, tensor <?xi32 >) map_clauses (from ) capture (ByRef ) -> memref <?xi32 >
22
+ %map_c = omp.map.info var_ptr (%c: memref <?xi32 >, tensor <?xi32 >) map_clauses (exit_release_or_enter_alloc ) capture (ByRef ) -> memref <?xi32 >
23
23
24
24
// Do some work on the host that writes to 'a'
25
25
omp.task depend (taskdependout -> %a : memref <?xi32 >) {
@@ -28,7 +28,7 @@ func.func @omp_target_enter_update_exit_data_depend(%a: memref<?xi32>, %b: memre
28
28
}
29
29
30
30
// Then map that over to the target
31
- // CHECK: omp.task depend(taskdependin -> [[ARG0]] : memref<?xi32>)
31
+ // CHECK: omp.task if(%true) depend(taskdependin -> [[ARG0]] : memref<?xi32>)
32
32
// CHECK: omp.target_enter_data nowait map_entries([[MAP0]], [[MAP2]] : memref<?xi32>, memref<?xi32>)
33
33
omp.target_enter_data nowait map_entries (%map_a , %map_c: memref <?xi32 >, memref <?xi32 >) depend (taskdependin -> %a: memref <?xi32 >)
34
34
@@ -46,21 +46,21 @@ func.func @omp_target_enter_update_exit_data_depend(%a: memref<?xi32>, %b: memre
46
46
}
47
47
48
48
// Copy the updated 'a' onto the target
49
- // CHECK: omp.task depend(taskdependin -> [[ARG0]] : memref<?xi32>)
50
- // CHECK: omp.target_update_data nowait motion_entries([[MAP0]] : memref<?xi32>)
51
- omp.target_update_data motion_entries (%map_a : memref <?xi32 >) depend (taskdependin -> %a : memref <?xi32 >) nowait
49
+ // CHECK: omp.task if(%true) depend(taskdependin -> [[ARG0]] : memref<?xi32>)
50
+ // CHECK: omp.target_update nowait motion_entries([[MAP0]] : memref<?xi32>)
51
+ omp.target_update motion_entries (%map_a : memref <?xi32 >) depend (taskdependin -> %a : memref <?xi32 >) nowait
52
52
53
53
// Compute 'c' on the target and copy it back
54
- // CHECK:[[MAP3:%.*]] = omp.map_info var_ptr([[ARG2]] : memref<?xi32>, tensor<?xi32>) map_clauses(from) capture(ByRef) -> memref<?xi32>
55
- %map_c_from = omp.map_info var_ptr (%c: memref <?xi32 >, tensor <?xi32 >) map_clauses (from ) capture (ByRef ) -> memref <?xi32 >
56
- // CHECK: omp.task depend(taskdependout -> [[ARG2]] : memref<?xi32>)
54
+ // CHECK:[[MAP3:%.*]] = omp.map.info var_ptr([[ARG2]] : memref<?xi32>, tensor<?xi32>) map_clauses(from) capture(ByRef) -> memref<?xi32>
55
+ %map_c_from = omp.map.info var_ptr (%c: memref <?xi32 >, tensor <?xi32 >) map_clauses (from ) capture (ByRef ) -> memref <?xi32 >
56
+ // CHECK: omp.task if(%false) depend(taskdependout -> [[ARG2]] : memref<?xi32>)
57
57
// CHECK: omp.target map_entries([[MAP0]] -> {{%.*}}, [[MAP3]] -> {{%.*}} : memref<?xi32>, memref<?xi32>) {
58
58
omp.target map_entries (%map_a -> %arg0 , %map_c_from -> %arg1 : memref <?xi32 >, memref <?xi32 >) depend (taskdependout -> %c : memref <?xi32 >) {
59
59
^bb0 (%arg0 : memref <?xi32 >, %arg1 : memref <?xi32 >) :
60
60
" test.foobar" () : ()->()
61
61
omp.terminator
62
62
}
63
- // CHECK: omp.task depend(taskdependin -> [[ARG2]] : memref<?xi32>) {
63
+ // CHECK: omp.task if(%false) depend(taskdependin -> [[ARG2]] : memref<?xi32>) {
64
64
// CHECK: omp.target_exit_data map_entries([[MAP2]] : memref<?xi32>)
65
65
omp.target_exit_data map_entries (%map_c : memref <?xi32 >) depend (taskdependin -> %c : memref <?xi32 >)
66
66
return
0 commit comments