[all-commits] [llvm/llvm-project] 84c3b0: [OpenMP][flang][MLIR] Decouple alloc, init, and co...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Thu Feb 6 02:46:02 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 84c3b05e5e2776af51a2791bccfaa954bc8e2bcd
      https://github.com/llvm/llvm-project/commit/84c3b05e5e2776af51a2791bccfaa954bc8e2bcd
  Author: Kareem Ergawy <kareem.ergawy at amd.com>
  Date:   2025-02-06 (Thu, 06 Feb 2025)

  Changed paths:
    M flang/test/Integration/OpenMP/parallel-private-reduction-worstcase.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/openmp-firstprivate.mlir
    M mlir/test/Target/LLVMIR/openmp-llvm.mlir
    M mlir/test/Target/LLVMIR/openmp-private.mlir
    M mlir/test/Target/LLVMIR/openmp-wsloop-private-cond_br.mlir

  Log Message:
  -----------
  [OpenMP][flang][MLIR] Decouple alloc, init, and copy regions for `omp.private|declare_reduction` ops (#125699)

This PR changes the emitted block structure of alloc, init, and copy
regions for `omp.private` and `omp.declare_reduction` ops a little bit.
In particular, this decouples init and copy regions from the alloca
insertion-point. The main motivation is fix "Instruction does not
dominate all uses!" errors that happen specially when an init region
uses a value from the OpenMP region it is being inlined into. The issue
happens because, previous to this PR, we inline the init region right
after the latest alloc block (since we used the alloca IP); which in
some cases (see exmaple below), is too early and causes the use
dominance issue.

Example that would break without this PR (when delayed privatization is
enabled for `omp.wsloop`s):
```fortran
subroutine test2 (xyz)
  integer :: i
  integer :: xyz(:)

  !$omp target map(from:xyz)
    !$omp do private(xyz)
      do i = 1, 10
        xyz(i) = i
      end do
  !$omp end target
end subroutine
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list