@@ -158,6 +158,22 @@ static LogicalResult checkImplementationStatus(Operation &op) {
158
158
if (op.getBare ())
159
159
result = todo (" ompx_bare" );
160
160
};
161
+ auto checkCancelDirective = [&todo](auto op, LogicalResult &result) {
162
+ omp::ClauseCancellationConstructType cancelledDirective =
163
+ op.getCancelDirective ();
164
+ // Cancelling a taskloop is not yet supported because we don't yet have LLVM
165
+ // IR conversion for taskloop
166
+ if (cancelledDirective == omp::ClauseCancellationConstructType::Taskgroup) {
167
+ Operation *parent = op->getParentOp ();
168
+ while (parent) {
169
+ if (parent->getDialect () == op->getDialect ())
170
+ break ;
171
+ parent = parent->getParentOp ();
172
+ }
173
+ if (isa_and_nonnull<omp::TaskloopOp>(parent))
174
+ result = todo (" cancel directive inside of taskloop" );
175
+ }
176
+ };
161
177
auto checkDepend = [&todo](auto op, LogicalResult &result) {
162
178
if (!op.getDependVars ().empty () || op.getDependKinds ())
163
179
result = todo (" depend" );
@@ -234,6 +250,10 @@ static LogicalResult checkImplementationStatus(Operation &op) {
234
250
235
251
LogicalResult result = success ();
236
252
llvm::TypeSwitch<Operation &>(op)
253
+ .Case ([&](omp::CancelOp op) { checkCancelDirective (op, result); })
254
+ .Case ([&](omp::CancellationPointOp op) {
255
+ checkCancelDirective (op, result);
256
+ })
237
257
.Case ([&](omp::DistributeOp op) {
238
258
checkAllocate (op, result);
239
259
checkDistSchedule (op, result);
0 commit comments