| 1 |
// RUN: fir-opt --split-input-file --lower-workshare --allow-unregistered-dialect %s | FileCheck %s |
| 2 |
|
| 3 |
// Checks that the omp.workshare.loop_wrapper binds to the correct omp.workshare |
| 4 |
|
| 5 |
func.func @wsfunc() { |
| 6 |
%c1 = arith.constant 1 : index |
| 7 |
%c42 = arith.constant 42 : index |
| 8 |
omp.parallel { |
| 9 |
omp.workshare nowait { |
| 10 |
omp.parallel { |
| 11 |
omp.workshare nowait { |
| 12 |
omp.workshare.loop_wrapper { |
| 13 |
omp.loop_nest (%arg1) : index = (%c1) to (%c42) inclusive step (%c1) { |
| 14 |
"test.test2"() : () -> () |
| 15 |
omp.yield |
| 16 |
} |
| 17 |
} |
| 18 |
omp.terminator |
| 19 |
} |
| 20 |
omp.terminator |
| 21 |
} |
| 22 |
omp.terminator |
| 23 |
} |
| 24 |
omp.terminator |
| 25 |
} |
| 26 |
return |
| 27 |
} |
| 28 |
|
| 29 |
// CHECK-LABEL: func.func @wsfunc() { |
| 30 |
// CHECK: %[[VAL_0:.*]] = arith.constant 1 : index |
| 31 |
// CHECK: %[[VAL_1:.*]] = arith.constant 42 : index |
| 32 |
// CHECK: omp.parallel { |
| 33 |
// CHECK: omp.single nowait { |
| 34 |
// CHECK: omp.parallel { |
| 35 |
// CHECK: omp.wsloop nowait { |
| 36 |
// CHECK: omp.loop_nest (%[[VAL_2:.*]]) : index = (%[[VAL_0]]) to (%[[VAL_1]]) inclusive step (%[[VAL_0]]) { |
| 37 |
// CHECK: "test.test2"() : () -> () |
| 38 |
// CHECK: omp.yield |
| 39 |
// CHECK: } |
| 40 |
// CHECK: } |
| 41 |
// CHECK: omp.terminator |
| 42 |
// CHECK: } |
| 43 |
// CHECK: omp.terminator |
| 44 |
// CHECK: } |
| 45 |
// CHECK: omp.terminator |
| 46 |
// CHECK: } |
| 47 |
// CHECK: return |
| 48 |
// CHECK: } |
| 49 |
|