llvm-project
79813463 - [flang][DoConcurrent] Map reduction variables as tofrom ByRef for device offloading

Commit
23 days ago
[flang][DoConcurrent] Map reduction variables as tofrom ByRef for device offloading Scalar reduction variables in `do concurrent reduce(...)` were being mapped with `implicit ByCopy` when offloaded to device, because `genMapInfoOpForLiveIn` treated all trivial types uniformly. This caused the reduction result to be silently dropped — the device-side reduction would compute the correct value but never write it back to the host. Fix by detecting reduction variables and forcing `implicit tofrom ByRef` mapping, matching the behavior of explicit `!$omp target teams distribute parallel do reduction(...)`. Co-authored-by: ergawy <kareem.ergawy@amd.com> Co-authored-by: Claude <noreply@anthropic.com> Made-with: Cursor
Author
Committer
Parents
Loading