File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3217,7 +3217,8 @@ LogicalResult CancelOp::verify() {
3217
3217
}
3218
3218
}
3219
3219
if ((cct == ClauseCancellationConstructType::Taskgroup) &&
3220
- !mlir::isa<omp::TaskOp>(structuralParent)) {
3220
+ (!mlir::isa<omp::TaskOp>(structuralParent) &&
3221
+ !mlir::isa<omp::TaskloopOp>(structuralParent->getParentOp ()))) {
3221
3222
return emitOpError () << " cancel taskgroup must appear "
3222
3223
<< " inside a task region" ;
3223
3224
}
Original file line number Diff line number Diff line change @@ -2215,6 +2215,18 @@ func.func @omp_cancel_taskgroup() -> () {
2215
2215
return
2216
2216
}
2217
2217
2218
+ func.func @omp_taskloop_cancel_taskgroup (%lb : index , %ub : index , %step : index ) {
2219
+ omp.taskloop {
2220
+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2221
+ // CHECK: omp.cancel cancellation_construct_type(taskgroup)
2222
+ omp.cancel cancellation_construct_type (taskgroup )
2223
+ // CHECK: omp.yield
2224
+ omp.yield
2225
+ }
2226
+ }
2227
+ return
2228
+ }
2229
+
2218
2230
func.func @omp_cancel_parallel_nested (%if_cond : i1 ) -> () {
2219
2231
omp.parallel {
2220
2232
scf.if %if_cond {
You can’t perform that action at this time.
0 commit comments