[PATCH] D86071: [MLIR][OpenMP] Add omp.do operation
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 11 05:16:53 PDT 2020
jdoerfert added a comment.
In D86071#2267473 <https://reviews.llvm.org/D86071#2267473>, @ftynse wrote:
> 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?
A written version of the plan? Yes. A written version of the code, not yet.
>>> 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!
> [...]
> 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;
> [...]
So far that was not on my TODO list and it seems like a lot of work assuming you do not port various other things into MLIR land. Could you help me understand what we would gain by generating LLVM dialect?
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