[clang] [llvm] [mlir] [OMPIRBuilder] always leave PARALLEL via the same barrier (PR #164586)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 30 05:28:18 PDT 2025


Meinersbur wrote:

> I have a newbie (not familiar with the semantics of the `cancel` construct) question specially given the changes in this PR, what is the point of emitting the `__kmpc_cancel_barrier` specially that we now emit it at the very end of the parallel region?

If I recall from #130135 correctly, a `parallel` region has an implicit barrier at that end which is not handled any different than a `#pragma omp barrier`. That is, it must skip the remaining code in the region (of which there is none for the implicit end barrier). but also reset the "has this region been cancelled" flag so the next execution of the region does not immediately cancel again.

https://github.com/llvm/llvm-project/pull/164586


More information about the llvm-commits mailing list