File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3217,7 +3217,8 @@ LogicalResult CancelOp::verify() {
32173217 }
32183218 }
32193219 if ((cct == ClauseCancellationConstructType::Taskgroup) &&
3220- !mlir::isa<omp::TaskOp>(structuralParent)) {
3220+ (!mlir::isa<omp::TaskOp>(structuralParent) &&
3221+ !mlir::isa<omp::TaskloopOp>(structuralParent->getParentOp ()))) {
32213222 return emitOpError () << " cancel taskgroup must appear "
32223223 << " inside a task region" ;
32233224 }
Original file line number Diff line number Diff line change @@ -2215,6 +2215,18 @@ func.func @omp_cancel_taskgroup() -> () {
22152215 return
22162216}
22172217
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+
22182230func.func @omp_cancel_parallel_nested (%if_cond : i1 ) -> () {
22192231 omp.parallel {
22202232 scf.if %if_cond {
You can’t perform that action at this time.
0 commit comments