Skip to content

Commit d001eec

Browse files
committed
Fix op tests
1 parent f8d7b47 commit d001eec

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,8 @@ void WorkshareOp::build(OpBuilder &builder, OperationState &state,
19371937
LogicalResult WorkshareLoopWrapperOp::verify() {
19381938
if (!(*this)->getParentOfType<WorkshareOp>())
19391939
return emitError() << "must be nested in an omp.workshare";
1940+
if (getNestedWrapper())
1941+
return emitError() << "cannot be composite";
19401942
return success();
19411943
}
19421944

mlir/test/Dialect/OpenMP/invalid.mlir

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,15 +2581,13 @@ func.func @omp_taskloop_invalid_composite(%lb: index, %ub: index, %step: index)
25812581
// -----
25822582
func.func @nested_wrapper(%idx : index) {
25832583
omp.workshare {
2584-
// expected-error @below {{nested wrappers not supported}}
2584+
// expected-error @below {{cannot be composite}}
25852585
omp.workshare.loop_wrapper {
25862586
omp.simd {
25872587
omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {
25882588
omp.yield
25892589
}
2590-
omp.terminator
2591-
}
2592-
omp.terminator
2590+
} {omp.composite}
25932591
}
25942592
omp.terminator
25952593
}
@@ -2599,9 +2597,9 @@ func.func @nested_wrapper(%idx : index) {
25992597
// -----
26002598
func.func @not_wrapper() {
26012599
omp.workshare {
2602-
// expected-error @below {{must be a loop wrapper}}
2600+
// expected-error @below {{op nested in loop wrapper is not another loop wrapper or `omp.loop_nest`}}
26032601
omp.workshare.loop_wrapper {
2604-
omp.terminator
2602+
%0 = arith.constant 0 : index
26052603
}
26062604
omp.terminator
26072605
}
@@ -2615,7 +2613,6 @@ func.func @missing_workshare(%idx : index) {
26152613
omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {
26162614
omp.yield
26172615
}
2618-
omp.terminator
26192616
}
26202617
return
26212618
}

0 commit comments

Comments
 (0)