[PATCH] D86071: [MLIR][OpenMP] Add omp.do operation

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 01:49:37 PDT 2020


ftynse added a comment.

In D86071#2266254 <https://reviews.llvm.org/D86071#2266254>, @jdoerfert wrote:

> In D86071#2266169 <https://reviews.llvm.org/D86071#2266169>, @ftynse wrote:
>
>>> It has to be the OpenMPIRBuilder that lowers it into a CFG (eventually) because it is not "a fortran/mlir/affine/... loop" but an OpenMP worksharing loop with all what that entails.
>>
>> If there is an `OpenMPIRBuilder::CreateForLoop` or a plan to have it? So far, it looks a there is a non-negligible amount of code in Clang that emits the IR for loops, and replicating that code in mlir-translate is a no go.
>
>
>
> In D86071#2266169 <https://reviews.llvm.org/D86071#2266169>, @ftynse wrote:
>
>>> It has to be the OpenMPIRBuilder that lowers it into a CFG (eventually) because it is not "a fortran/mlir/affine/... loop" but an OpenMP worksharing loop with all what that entails.
>>
>> If there is an `OpenMPIRBuilder::CreateForLoop` or a plan to have it?
>
> Yes.

Is there a written version somewhere we can see?

>> So far, it looks a there is a non-negligible amount of code in Clang that emits the IR for loops, and replicating that code in mlir-translate is a no go.
>
> All OpenMP related LLVM-IR code generation is (eventually) going to be moved into `OpenMPIRBuilder` so we do not duplicate the rather nontrivial parts in two places which would become a maintenance nightmare. That is (among other things) the point ;)

This sounds great! What I am missing is how this connects to MLIR. Two particular issues: how the OpenMP dialect interacts with other dialects, and can the OpenMPIRBuilder be designed so as to eventually take an `mlir::Builder` instead of `llvm::IRBuilder<>` and produce LLVM dialect instead of LLVM; there may be others. So far, the implementation of `omp.do` proposed here does not align, if not contradicts, the original RFC <https://llvm.discourse.group/t/rfc-openmp-dialect-in-mlir/397>. Bottomline, this deserves a proper discussion in a forum with better visibility than code review. Part of the discussion seemingly happens in flang channels and should be somehow summarized for mlir folks as OpenMP dialect being independent of any Fortran construct was a condition for accepting it in core.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86071/new/

https://reviews.llvm.org/D86071



More information about the llvm-commits mailing list