[flang] [llvm] [mlir] [llvm][mlir][OpenMP] Support translation for linear clause in omp.wsloop (PR #139386)
via llvm-commits
llvm-commits at lists.llvm.org
Sat May 10 08:30:55 PDT 2025
NimishMishra wrote:
The following test case from OpenMP examples document compiles successfully with a combination of PR https://github.com/llvm/llvm-project/pull/139385 and this PR:
```
program linear_loop
use omp_lib
implicit none
integer, parameter :: N = 100
real :: a(N), b(N/2)
integer :: i, j
do i = 1, N
a(i) = i
end do
j = 0
!$omp parallel
!$omp do linear(j:1)
do i = 1, N, 2
j = j + 1
b(j) = a(i) * 2.0
end do
!$omp end parallel
print *, j, b(1), b(j)
! print out: 50 2.0 198.0
end program
```
Flang output: `50 2. 198.` as expected.
https://github.com/llvm/llvm-project/pull/139386
More information about the llvm-commits
mailing list