This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Allow hlfir.assign expansion for array slices.
ClosedPublic

Authored by vzakhari on Aug 31 2023, 6:07 PM.

Details

Summary

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.

Diff Detail

Event Timeline

vzakhari created this revision.Aug 31 2023, 6:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2023, 6:07 PM
vzakhari requested review of this revision.Aug 31 2023, 6:07 PM
tblah accepted this revision.Sep 1 2023, 2:33 AM

Great work! Really quick fixing all of these

This revision is now accepted and ready to land.Sep 1 2023, 2:33 AM

Great work! Really quick fixing all of these

Thank you for the review, Tom!