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

via flang-commits flang-commits at lists.llvm.org
Mon Oct 16 10:07:40 PDT 2023


agozillon wrote:

> > This example also shows that it is concerning making all mapping decisions so early in order to satisfy the IsolatedFromAbove property. Namely, this case would ideally be map(tofrom:a(11,22)) not a map(tofrom:a). Maybe it is indeed possible for this case - but consider a simple loop modifying `a(11,22+ii)`. Wouldn't it be great to just map what is needed? Hard to get this info at lowering. https://www.openmp.org/spec-html/5.2/openmpsu60.html
> > I wonder if it should be considered to add the trait IsolatedFromAbove sometime after lowering and after running the passes that will decide values passed by reference/value and those that decide the mapping actions for implicit data mapping attributes.
> 
> That is a good point. I guess, we could distinguish between `user-provided` mapping and `implicit` mapping by adding another field to `omp.map_info` and then subsequent passes in MLIR can update or replace the `implicit` mappings. The `implicit` mappings can start by assuming the worst case if there are variables involved.

I did originally add a boolean field to indicate if something is implicit or not, so in theory I suppose we could use that to indicate if something is an implicit mapping vs user specified. And then subsequent passes could check if the field is toggled and based on that do further processing. Perhaps the bool is too simple for what you're currently envisioning though!

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


More information about the flang-commits mailing list