[Mlir-commits] [mlir] [mlir][OpenMP] Convert omp.cancel parallel to LLVMIR (PR #137192)
Sergio Afonso
llvmlistbot at llvm.org
Fri Apr 25 05:47:36 PDT 2025
================
@@ -1580,6 +1587,21 @@ cleanupPrivateVars(llvm::IRBuilderBase &builder,
return success();
}
+/// Returns true if the construct contains omp.cancel or omp.cancellation_point
+static bool constructIsCancellable(Operation *op) {
+ // omp.cancel must be "closely nested" so it will be visible and not inside of
+ // funcion calls. This is enforced by the verifier.
+ bool containsCancel = false;
+ op->walk([&containsCancel](Operation *child) {
+ if (mlir::isa<omp::CancelOp>(child)) {
----------------
skatrak wrote:
Should we pass an `omp::ClauseCancellationConstructType` argument or check the type of `op` and make sure the `omp.cancel` operation we found applies to that construct, or does the existence of any cancel directive at all inside of the construct makes it cancellable, even if it applies to another?
https://github.com/llvm/llvm-project/pull/137192
More information about the Mlir-commits
mailing list