[Mlir-commits] [flang] [mlir] [OpenMP][Flang] Add "IsolatedFromAbove" trait to omp.target (PR #67164)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Nov 1 11:05:56 PDT 2023


agozillon wrote:

> > @kiranchandramohan @jeanPerier Sorry to bother both of you, but I've run into an issue with this patch.
> > When the target region contains a do while loop like in the example below, the loop code is absent entirely from the generated FIR/HLFIR.
> > This happens for the target data directive as well for which we added a similar custom region body generator some time back.
> > Any idea why?
> 
> I am assuming this happens only when there is unstructured code (code with jumps, do while etc) in the body of the operation. There is some special handling for unstructured code, have a look at
> 
> https://github.com/llvm/llvm-project/blob/6c320b434d249c0d5692cbecc0e67ec22d659b7e/flang/lib/Lower/OpenMP.cpp#L2132
> 
> This is a separate issue and can be fixed in another patch.

Unfortunately this breaks a bunch of the runtime tests we currently have working in the openmp fortran test directory. Although, they can be converted to do loops, instead of while loops when this patch lands, if that helps work around the issue with while loops at all (the main reason they're do while, is lack of implicit capture handling which this patch series begins to tackle). 

If it is a problem even for do loops, then I imagine that could be a little bit of an issue to maintain downstream as well, as we try to keep as close to top of the tree as we can right now and are doing a lot of work on loop related offload constructs.

However, I'm not opposed to dealing with it in a seperate patch if that is what we wish to do, just personally not a huge fan of landing this and breaking what we have working currently, as we try to find a fix.

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


More information about the Mlir-commits mailing list