[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
Thu Jul 23 07:22:55 PDT 2026
sbryngelson wrote:
Both addressed, thanks.
`cmake.log` was mine, committed by a careless `git add -A`. Removed.
On the RHS: you are right, and the predicate was too weak. It only checked that the LHS was copy-region argument 1, so a clone-rooted RHS in that region would have bypassed the aliasing check and been lowered as a non-overlapping element loop.
It now also requires the RHS to be provably rooted in argument 0. The walk returns false on reaching argument 1, on any value with no defining operation, and on any operation carrying regions, since such an operation can capture values that are not among its operands. Anything not recognised keeps the usual aliasing check rather than skipping it.
Added a test for the case you describe, a copy region whose RHS is loaded from the clone, which stays as an `hlfir.assign` and is not inlined.
check-flang is clean at `d1d3891077f6`: 4608 passed, 11 expected failures, no failures. The one-element `real(8)` case still emits no `_FortranAAssign` and still links and runs correctly on an MI210.
https://github.com/llvm/llvm-project/pull/211543
More information about the flang-commits
mailing list