Skip to content

[flang][hlfir] Better recognize non-overlapping array sections. #65707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

vzakhari
Copy link
Contributor

@vzakhari vzakhari commented Sep 8, 2023

This is a copy of the corresponding ArrayValueCopy analysis
for non-overlapping array slices. It is required to achieve
the same performance for Polyhedron/nf, though, additional
changes are needed in the alias analysis for disambiguating
host associated accesses.

This is a copy of the corresponding ArrayValueCopy analysis
for non-overlapping array slices. It is required to achieve
the same performance for Polyhedron/nf, though, additional
changes are needed in the alias analysis for disambiguating
host associated accesses.
@vzakhari vzakhari requested review from tblah and jeanPerier September 8, 2023 03:17
@vzakhari vzakhari requested a review from a team as a code owner September 8, 2023 03:17
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Sep 8, 2023
Copy link
Contributor

@jeanPerier jeanPerier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Nice work. Is that all of the performance stuff done?

@vzakhari
Copy link
Contributor Author

vzakhari commented Sep 8, 2023

Looks good to me! Nice work. Is that all of the performance stuff done?

Unfortunately, this does not resolve the nf performance regression. In the benchmark, in addition to non-overlapping slices of x on the LHS and RHS, there is a use of a host associated variable on the RHS, and this use is reported as conflicting by the current alias analysis. ArrayValueCopy is able to claim no-overlap in this case somehow. The chain of operations for this host associated variable access up to the dummy block argument (for the host associated variables) looks quite complex, e.g. there are indexing of the host associate block and box loads. I think we may need to attribute the corresponding hlfir.declare with fir.host_assoc so that the alias analysis can disambiguate dummy argument accesses vs the host associated variables accesses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants