Skip to content

Commit 5760383

Browse files
committed
Different warning
1 parent 4d20893 commit 5760383

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

flang/lib/Optimizer/OpenMP/LowerWorkshare.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ bool shouldUseWorkshareLowering(Operation *op) {
9494
if (isNestedIn<omp::SingleOp>(parentWorkshare, op))
9595
return false;
9696

97-
if (parentWorkshare.getRegion().getBlocks().size() != 1) {
98-
parentWorkshare->emitWarning(
99-
"omp workshare with unstructured control flow currently unsupported.");
97+
// Do not use workshare lowering until we support CFG in omp.workshare
98+
if (parentWorkshare.getRegion().getBlocks().size() != 1)
10099
return false;
101-
}
102100

103101
return true;
104102
}
@@ -448,6 +446,9 @@ LogicalResult lowerWorkshare(mlir::omp::WorkshareOp wsOp, DominanceInfo &di) {
448446
} else {
449447
// Otherwise just change the operation to an omp.single.
450448

449+
wsOp->emitWarning("omp workshare with unstructured control flow currently "
450+
"unsupported and will be serialized.");
451+
451452
// `shouldUseWorkshareLowering` should have guaranteed that there are no
452453
// omp.workshare_loop_wrapper's that bind to this omp.workshare.
453454
assert(!wsOp->walk([&](Operation *op) {

flang/test/Transforms/OpenMP/lower-workshare-todo-cfg-dom.mlir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: fir-opt --lower-workshare --allow-unregistered-dialect %s 2>&1 | FileCheck %s
22

3+
// CHECK: warning: omp workshare with unstructured control flow currently unsupported and will be serialized.
4+
35
// CHECK: omp.parallel
46
// CHECK-NEXT: omp.single
57

flang/test/Transforms/OpenMP/lower-workshare-todo-cfg.mlir

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// RUN: fir-opt --lower-workshare --allow-unregistered-dialect %s 2>&1 | FileCheck %s
22

3+
// CHECK: warning: omp workshare with unstructured control flow currently unsupported and will be serialized.
4+
35
// CHECK: omp.parallel
46
// CHECK-NEXT: omp.single
57

0 commit comments

Comments
 (0)