Skip to content
Commit 8f1671c0 authored by Slava Zakharin's avatar Slava Zakharin
Browse files

[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
parent 460bba35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment