[all-commits] [llvm/llvm-project] 8f1671: [flang][hlfir] Allow hlfir.assign expansion for ar...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Fri Sep 1 12:09:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f1671c065539965834132c682da05dd8858b42d
      https://github.com/llvm/llvm-project/commit/8f1671c065539965834132c682da05dd8858b42d
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
    A flang/test/HLFIR/opt-array-slice-assign.fir

  Log Message:
  -----------
  [flang][hlfir] Allow hlfir.assign expansion for array slices.

This case is important for `Polyhedron/channel2`:
```
    u(2:M-1,1:N,new) = u(2:M-1,1:N,old) &
        +2.d0*dt*f(2:M-1,1:N)*v(2:M-1,1:N,mid) &
        -2.d0*dt/(2.d0*dx)*g*dhdx(2:M-1,1:N)
```

The slices of `u` on the left and the right hand sides are completely
disjoint, but `old` and `new` are unknown runtime values. So the slices
may also be identical rather than disjoint. For the purpose of
hlfir.assign expansion we do not care whether they are identical or
disjoint. Such kind of an answer does not fit well into the alias
analysis definition, so I added a very simplified check to handle
this case. This drops icelake execution time from 120 to 70 seconds.

Reviewed By: tblah

Differential Revision: https://reviews.llvm.org/D159323




More information about the All-commits mailing list