Skip to content

[mlir][bufferization][WIP] Use BufferOriginAnalysis to fold away dealloc runtime checks #79602

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

Closed

Conversation

matthias-springer
Copy link
Member

@matthias-springer matthias-springer commented Jan 26, 2024

This commit adds the BufferOriginAnalysis, which can be queried by the buffer deallocation pass to check if two buffers originate from the same allocation.

This analysis enables additional simplifications during -buffer-deallocation-simplification. In particular, "regular" scf.for loop nests, that yield buffers (or reallocations thereof) in the same order as they appear in the iter_args, are now handled much more efficiently. (TODO: Add test case.) Such IR patterns are generated by the sparse compiler.

Depends on #78718. Review only the top commit.

This commit adds the `BufferViewFlowOpInterface` to the bufferization dialect. This interface can be implemented by ops that operate on buffers to indicate that a buffer op result and/or region entry block argument may be the same buffer as a buffer operand (or a view thereof). This interface is queried by the `BufferViewFlowAnalysis`.

There are currently no ops that implement this interface. The first op implementations will be added in a consecutive commit.

BEGIN_PUBLIC
No public commit message needed for presubmit.
END_PUBLIC
@matthias-springer
Copy link
Member Author

Re-uploaded to LLVM github repo as #86461.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant