[all-commits] [llvm/llvm-project] 599da9: [flang][OpenMP] Add `OutlineableOpenMPOpInterface`...

Kareem Ergawy via All-commits all-commits at lists.llvm.org
Thu Mar 13 02:12:52 PDT 2025


  Branch: refs/heads/users/ergawy/omp_teams_outlinable
  Home:   https://github.com/llvm/llvm-project
  Commit: 599da9d50b4102c7756aee674b9dafab3fc0031a
      https://github.com/llvm/llvm-project/commit/599da9d50b4102c7756aee674b9dafab3fc0031a
  Author: ergawy <kareem.ergawy at amd.com>
  Date:   2025-03-13 (Thu, 13 Mar 2025)

  Changed paths:
    A flang/test/Fir/omp-teams.fir
    M flang/test/Transforms/stack-arrays-hlfir.f90
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td

  Log Message:
  -----------
  [flang][OpenMP] Add `OutlineableOpenMPOpInterface` to `omp.teams`

Given the following input:
```fortran
program rep_loopbind
  implicit none
  integer :: i
  real :: priv_val

  !$omp teams private(priv_val)
    !$omp distribute
    do i=1,1000
    end do
  !$omp end teams
end program
```
the `AllocaOpConversion` pattern in `FIRToLLVMLowering` would **move**
the private allocations that belong to the `teams` directive (i.e. the
allocations needed for the private copies of `priv_val` and the loop's
iteration variable) from the the `omp.teams` op to the outside scope.

This is not correct since these allocations should be eventually emitted
inside the outlined region for the `teams` directive. Without this fix,
these allocation would be emitted in the parent function (or the parent
scope whatever it is).



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