[Mlir-commits] [mlir] [MLIR][OpenMP] Add omp.loop_nest operation (PR #87083)
Sergio Afonso
llvmlistbot at llvm.org
Wed Apr 10 03:28:31 PDT 2024
skatrak wrote:
> What is the mechanism we now have to avoid code appearing between loop_nest and the wrapper operation?
The `LoopWrapperInterface` (in the follow-up PR: #87232) defines an `isWrapper()` method that checks that the operation region only contains a single block with a single wrapper or `omp.loop_nest` and a terminator. Then, the wrapper op's verifier can be updated to make sure this is the case (e.g. [#87239](https://github.com/llvm/llvm-project/pull/87239/files#diff-a897370ad8f5ad37e8c1adb3c145c2304aaa38da3227bc1d02ac701ee8dc0754), [#87253](https://github.com/llvm/llvm-project/pull/87253/files#diff-a897370ad8f5ad37e8c1adb3c145c2304aaa38da3227bc1d02ac701ee8dc0754), [#87365](https://github.com/llvm/llvm-project/pull/87365/files#diff-a897370ad8f5ad37e8c1adb3c145c2304aaa38da3227bc1d02ac701ee8dc0754)). One operation where this doesn't always need to be checked would be `omp.parallel`, which can be a wrapper op when representing loop constructs such as `distribute parallel do`, but it can also work as a regular op when it is used standalone or as part of a combined (not composite) construct (e.g. `parallel do`).
https://github.com/llvm/llvm-project/pull/87083
More information about the Mlir-commits
mailing list