[flang-commits] [flang] [flang][OpenMP] Inline the firstprivate array copy instead of calling Assign() (PR #211543)
Spencer Bryngelson via flang-commits
flang-commits at lists.llvm.org
Fri Jul 24 06:40:23 PDT 2026
sbryngelson wrote:
Applied all three.
- `getCopyMoldArg()` / `getCopyPrivateArg()` for the two args.
- POINTER guard: if the mold is a pointer box, keep the aliasing check. firstprivate preserves the association, so mold and clone share data. Same treatment as #209539.
- POINTER negative test: fails without the guard, passes with it.
You're right on reachability. A POINTER copy region lowers to `fir.load %arg0` + `fir.store %0 to %arg1`, not `hlfir.assign`, so this pass never sees it. The guard and test only catch a future codegen change.
On "still needed after #209539": no, if #209539 lands. It fixes the alias analysis directly, so `InlineHLFIRAssign`'s existing `aliasRes.isNo()` path inlines the copy without this special case, and it covers every consumer rather than one call site. Happy to close this in its favor. I hardened mine in case #209539 stalls, but would rather not keep two fixes for one problem. Which do you and @bhandarkar-pranav prefer?
https://github.com/llvm/llvm-project/pull/211543
More information about the flang-commits
mailing list