[flang-commits] [flang] [flang][MLIR][OpenMP] Extend delayed privatization for arrays (PR #85023)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 20 20:48:53 PDT 2024


https://github.com/NimishMishra commented:

Thank you for the patch. I was trying to understand the changes with simpler examples of the form:

```
program main
    implicit none
    integer :: i
    real, dimension(5) :: array

    !$omp parallel private(array)
       array(2) = array(2) + 10
    !$omp end parallel
end program
```

It turns out that with `-mmlir --openmp-enable-delayed-privatization` flag, we get the following verification failure:

```
error: loc("/home/user1/.llvm/test/par.f90":4:27): 'hlfir.declare' op of array entity with a raw address base must have a shape operand that is a shape or shapeshift
error: loc("/home/user1/.llvm/test/par.f90":4:27): 'fir.shape' op using value defined outside the region
error: loc("/home/user1/.llvm/test/par.f90":4:27): 'hlfir.declare' op of array entity with a raw address base must have a shape operand that is a shape or shapeshift
```

I am not completely sure what went wrong here. 

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


More information about the flang-commits mailing list