llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Flang][OpenMP] Regression: reduction on an array section aborts with "not yet implemented" (since #196094)

Open blazie2004 opened this issue 4 months ago • 3 comments

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.

blazie2004 avatar Jul 14 '26 12:07 blazie2004

Hey i want to work on this, I'm not beginner in LLVM

purnima-nlp avatar Jul 14 '26 13:07 purnima-nlp

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.

Saieiei avatar Jul 14 '26 14:07 Saieiei

@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.