[Mlir-commits] [llvm] [mlir] [MLIR][OpenMP] Add Taskloop Collapse Support (PR #175924)

Kaviya Rajendiran llvmlistbot at llvm.org
Mon Jan 19 05:24:42 PST 2026


https://github.com/kaviya2510 commented:

Apologies for the late review, as I was away for a few days.

Thankyou for the patch @Stylie777. Before reviewing the implementation in detail, I tested the current implementation with different testcases. It works for a basic testcase with `collapse clause`. However, a test case with `non-unit stride` and `negative bounds` does not work with this implementation. Could you please take a look?

```fortran
non-unit-stride.f90

program test_non_stride
   integer :: i, j
   integer :: count = 20
  !$omp taskloop collapse(2)
  do i = 2, 10, 2    ! Even numbers: 2,4,6,8,10
    do j = 5, 15, 3   ! Steps of 3: 5,8,11,14
      count = count + 1
      print *, "i value ",i, " j value ", j
    end do
  end do
  !$omp end taskloop
end program
```
gfortran result: https://godbolt.org/z/9E3oY8f3K

```fortran
negative-bounds.f90

program test_negative_bounds
   integer :: i, j
   integer :: count = 20
  !$omp taskloop collapse(2)
  do i = -2, 10, 2    ! Even numbers: -2,0, 2,4,6,8,10
    do j = 5, 15, 3   ! Steps of 3: 5,8,11,14
      count = count + 1
      write(*,'("i= ",i0,",  j= ",i0)') i, j
    end do
  end do
  !$omp end taskloop
end program
```
gfortran result: https://godbolt.org/z/9dhf67dMv


https://github.com/llvm/llvm-project/pull/175924


More information about the Mlir-commits mailing list