[flang][DoConcurrent] Map reduction variables as tofrom ByRef for device offloading (#189378)
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
Fixes: https://github.com/ROCm/llvm-project/issues/1844
Co-authored-by: Claude <noreply@anthropic.com>