[flang-commits] [flang] [flang][openacc] Use original input for base address with optional (PR #80931)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Wed Feb 7 13:51:48 PST 2024


clementval wrote:

> > Mayeb we will need to change that somehow.
> 
> I think we may do something like this:
> 
> ```
>   if (IsPresent(base)) {
>     // All lowering of the variable reference in the data clause goes here.
>     // Bounds values are initialized here.
>     // The base address is initialized from the variable reference.
>   } else {
>     // Bounds values are initialized to empty set.
>     // The base address is initialized to null.
>   }
>   %bounds = acc.bounds (merged values from the above IF)
>   acc.copyin %bounds
> ```
> 
> It becomes hard to reason about the provenance of the variable in the data clause, though. So maybe we can try to put the whole `acc.copyin` operation under the `IsPresent` check. I have not thought through all the consequences of this yet.

This was my original idea but the operation that have dataClauseOperands expect the definingOp to be a DataClauseOp so this would currently fail the verifier. I need to think about the represenatation again so that we can fit the optional better. 

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


More information about the flang-commits mailing list