[Flang][OpenMP] Regression: reduction on an array section aborts with "not yet implemented" (since #196094)
Description
Since commit f6976c8e7be2 from PR #196094 ([Flang][OpenMP] Correct ArrayElements in Reduction Clause), an OpenMP reduction over an array section using an intrinsic reduction operator aborts the compiler.
Reproducer
! RUN: %flang_fc1 -emit-hlfir -fopenmp %s
subroutine s(a, n)
integer :: a(100), n
!$omp parallel do reduction(+:a(2:96))
do i = 1, n
a(2:96) = a(2:96) + i
end do
end subroutine s
Compile with:
flang -fc1 -emit-hlfir -fopenmp test.f90
Actual result
not yet implemented: creating reduction/privatization init region for unsupported type
LLVM ERROR: aborting
Expected result
The testcase should compile successfully.
Hey i want to work on this, I'm not beginner in LLVM
Thanks for your interest @purnima-nlp ! @blazei2004 already has a fix in progress and is close to opening a PR, so I’ve assigned it to them to avoid duplicate work.
@llvm/issue-subscribers-flang-ir
Author: jay0x (blazie2004)
Description
Since commit f6976c8e7be2 from PR #196094 ([Flang][OpenMP] Correct ArrayElements in Reduction Clause), an OpenMP reduction over an array section using an intrinsic reduction operator aborts the compiler.
Reproducer
! RUN: %flang_fc1 -emit-hlfir -fopenmp %s
subroutine s(a, n)
integer :: a(100), n
!$omp parallel do reduction(+:a(2:96))
do i = 1, n
a(2:96) = a(2:96) + i
end do
end subroutine s
Compile with:
flang -fc1 -emit-hlfir -fopenmp test.f90
Actual result
not yet implemented: creating reduction/privatization init region for unsupported type
LLVM ERROR: aborting
Expected result
The testcase should compile successfully.