[all-commits] [llvm/llvm-project] f3d3ec: [flang][acc] Add a missing acc.delete generation f...

khaki3 via All-commits all-commits at lists.llvm.org
Fri Jan 10 23:39:38 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3d3ec86d1a40a2c86d743384d272ebcd0a1cbd8
      https://github.com/llvm/llvm-project/commit/f3d3ec86d1a40a2c86d743384d272ebcd0a1cbd8
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2025-01-10 (Fri, 10 Jan 2025)

  Changed paths:
    M flang/lib/Lower/OpenACC.cpp
    M flang/test/Lower/OpenACC/acc-data-operands.f90
    M flang/test/Lower/OpenACC/acc-data.f90
    M flang/test/Lower/OpenACC/acc-declare-globals.f90
    M flang/test/Lower/OpenACC/acc-declare.f90
    M flang/test/Lower/OpenACC/acc-kernels-loop.f90
    M flang/test/Lower/OpenACC/acc-kernels.f90
    M flang/test/Lower/OpenACC/acc-parallel-loop.f90
    M flang/test/Lower/OpenACC/acc-parallel.f90
    M flang/test/Lower/OpenACC/acc-serial-loop.f90
    M flang/test/Lower/OpenACC/acc-serial.f90

  Log Message:
  -----------
  [flang][acc] Add a missing acc.delete generation for the copyin clause (#122539)

We are missing the deletion part of the copyin clause after a region or
in a destructor. This PR completes its implementation for data regions,
compute regions, and global declarations.

Example:
```f90
subroutine sub()
  real :: x(1:10)
  !$acc data copyin(x)
  !$acc end data
end subroutine sub
```
We are getting the following:
```mlir
    %5 = acc.copyin varPtr(%2#0 : !fir.ref<!fir.array<10xf32>>) bounds(%4) -> !fir.ref<!fir.array<10xf32>> {name = "x"}
    acc.data dataOperands(%5 : !fir.ref<!fir.array<10xf32>>) {
      acc.terminator
    }
    return
```
With this PR, we'll get:
```mlir
    %5 = acc.copyin varPtr(%2#0 : !fir.ref<!fir.array<10xf32>>) bounds(%4) -> !fir.ref<!fir.array<10xf32>> {name = "x"}
    acc.data dataOperands(%5 : !fir.ref<!fir.array<10xf32>>) {
      acc.terminator
    }
    acc.delete accPtr(%5 : !fir.ref<!fir.array<10xf32>>) bounds(%4) {dataClause = #acc<data_clause acc_copyin>, name = "x"}
    return
```



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