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

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Wed Feb 7 13:47:47 PST 2024


vzakhari 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.

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


More information about the flang-commits mailing list