This patch extends the existing WsLoop reduction IR generation to parallel blocks.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks @elmcdonough for the patch.
The reduction for the parallel construct should happen inside the parallel region (outlined function). At the moment, the code generated does this outside it.
Could you also check the case where the reduction happens in a nested region?
subroutine diff(nelt)
implicit none
integer :: ie, nelt, rho1
r1 = 0
!$OMP PARALLEL DEFAULT(SHARED) PRIVATE(ie) REDUCTION(+:r1)
!$OMP DO
do ie=1,nelt
r1 = r1 + ie
end do
!$OMP END DO
!$OMP END PARALLEL
endComment Actions
LG.
Could you check that the tests in gfortran testuite pass for parallel reduction before submitting?
https://github.com/llvm/llvm-test-suite/blob/745f3fdfe3f2f28dcea34e3e55fdc55aca06c00d/Fortran/gfortran/regression/gomp/DisabledFiles.cmake#L111
| mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp | ||
|---|---|---|
| 355–368 | Nit: Would this change work? | |
Nit: Would this change work?