|
2 | 2 |
|
3 | 3 | // Check that simd operations are not removed and rewritten, but all the other OpenMP ops are.
|
4 | 4 |
|
| 5 | +// CHECK: omp.private |
5 | 6 | // CHECK-LABEL: func.func @simd
|
6 | 7 | omp.private {type = private} @_QFEi_private_i32 : i32
|
7 | 8 | func.func @simd(%arg0: i32, %arg1: !fir.ref<i32>, %arg2: !fir.ref<i32>) {
|
@@ -49,6 +50,7 @@ func.func @simd_composite(%arg0: i32, %arg1: !fir.ref<i32>) {
|
49 | 50 |
|
50 | 51 | // -----
|
51 | 52 |
|
| 53 | +// CHECK-NOT: omp.private |
52 | 54 | // CHECK-LABEL: func.func @parallel
|
53 | 55 | omp.private {type = private} @_QFEi_private_i32 : i32
|
54 | 56 | func.func @parallel(%arg0: i32, %arg1: !fir.ref<i32>) {
|
@@ -326,6 +328,7 @@ func.func @sections(%funcArg0: i32, %funcArg1: !fir.ref<i32>, %funcArg2: !fir.re
|
326 | 328 |
|
327 | 329 | // -----
|
328 | 330 |
|
| 331 | +// CHECK-NOT: omp.declare_reduction |
329 | 332 | omp.declare_reduction @add_reduction_i32 : i32 init {
|
330 | 333 | ^bb0(%arg0: i32):
|
331 | 334 | %c0_i32 = arith.constant 0 : i32
|
@@ -620,3 +623,24 @@ func.func @do_multi_block(%funcArg0: i32, %funcArg1: !fir.ref<i32>, %6: i1) {
|
620 | 623 | }
|
621 | 624 | return
|
622 | 625 | }
|
| 626 | + |
| 627 | +// ----- |
| 628 | + |
| 629 | +// CHECK-LABEL: func.func @simd_nested_atomic( |
| 630 | +// CHECK-SAME: %[[ARG_0:.*]]: i32, %[[ARG_1:.*]]: !fir.ref<i32>, %[[ARG_2:.*]]: !fir.ref<i32> |
| 631 | +func.func @simd_nested_atomic(%arg0: i32, %arg1: !fir.ref<i32>, %arg2: !fir.ref<i32>) { |
| 632 | + %c1_i32 = arith.constant 1 : i32 |
| 633 | + %c100000_i32 = arith.constant 100000 : i32 |
| 634 | + // CHECK: omp.simd |
| 635 | + omp.simd { |
| 636 | + // CHECK: omp.loop_nest |
| 637 | + omp.loop_nest (%arg3) : i32 = (%c1_i32) to (%c100000_i32) inclusive step (%c1_i32) { |
| 638 | + // CHECK-NOT: omp.atomic.write |
| 639 | + // CHECK: fir.store %[[ARG_0]] to %[[ARG_2]] |
| 640 | + omp.atomic.write %arg2 = %arg0 : !fir.ref<i32>, i32 |
| 641 | + // CHECK: omp.yield |
| 642 | + omp.yield |
| 643 | + } |
| 644 | + } |
| 645 | + return |
| 646 | +} |
0 commit comments