[flang][OpenACC] Support DO CONCURRENT locality specs inside ACC constructs (#190406)
- Lower DO CONCURRENT locality specs (REDUCE, LOCAL, LOCAL\_INIT) that
appear inside OpenACC compute constructs and combined directives.
- Previously, any locality spec on DO CONCURRENT inside ACC hit a `TODO`
and aborted. This resolves that limitation.
- Per OpenACC 2.17.2, DO CONCURRENT without a loop construct in a
kernels construct is treated as `loop auto`; in a parallel construct it
is treated as `loop independent`. Both cases are covered.
## Mapping
| Locality Spec | ACC Operation |
|---|---|
| `REDUCE(op:vars)` | `acc.reduction` with reduction recipe |
| `LOCAL(vars)` | `acc.private` with privatization recipe |
| `LOCAL_INIT(vars)` | `acc.firstprivate` with firstprivatization recipe
|
| `SHARED` / `DEFAULT(NONE)` | No-op (variables already accessible) |
## Details
- Adds `processDoConcurrentLocalitySpecs` to convert locality specs into
the corresponding ACC data-entry operations and recipes.
- Handles the `HostAssoc` symbol indirection that DO CONCURRENT creates
for LOCAL/LOCAL\_INIT variables: after `remapDataOperandSymbols` binds
the ultimate symbol inside the compute region, the binding is copied to
the `HostAssoc` symbol so that body references resolve correctly.
- Separates `firstprivateOperands` into its own operand segment on
`acc.loop` (previously hardcoded empty).
- Fixes pre-existing build errors where `createOrGetReductionRecipe`,
`createOrGetPrivateRecipe`, and `createOrGetFirstprivateRecipe` were
called with `mlir::Type` instead of `mlir::Value` after an upstream API
change. The original variable is passed (not the acc op result) to
preserve correct recipe names.
- New FileCheck test
`flang/test/Lower/OpenACC/acc-do-concurrent-locality.f90` with 12 cases
covering REDUCE, LOCAL, LOCAL\_INIT, mixed locality, and interop with
explicit ACC clauses — across kernels regions, parallel regions, and
combined directives.