Skip to content
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

[mlir][bufferization] Empty tensor elimination based on SubsetOpInterface #65766

Merged

Conversation

matthias-springer
Copy link
Member

@matthias-springer matthias-springer commented Sep 8, 2023

This commit generalizes empty tensor elimination to operate on subset ops. No new test cases are added because all current subset ops were already supported previously. From this perspective, this change is NFC.

A new interface method (and a helper method) are added to SubsetInsertionOpInterface to build the subset of the destination tensor.

Comment on lines +114 to +116
"tensor.empty" ops cannot be bufferized. They can either be converted to
"bufferization.alloc_tensor" or replaced with another tensor (via this
transform). "tensor.empty" does not specify the contents of the returned
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering why you are replacing back ticks with "?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think backticks are used when referring to function/variable names only.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, I often do the exact opposite. Is there a written guideline somewhere?

…face

This commit generalizes empty tensor elimination to operate on subset ops. No new test cases are added because all current subset ops were already supported by previously. From this perspective, this change is NFC.

A new interface method (and a helper method) are added to `SubsetOpInterface` to build the subset of the destination tensor.
@matthias-springer matthias-springer force-pushed the subset_op_empty_tensor_elim branch from 97c2c4c to f40a969 Compare September 14, 2023 07:28
@matthias-springer matthias-springer merged commit a1ef5a9 into llvm:main Sep 14, 2023
kstoimenov pushed a commit to kstoimenov/llvm-project that referenced this pull request Sep 14, 2023
…face (llvm#65766)

This commit generalizes empty tensor elimination to operate on subset
ops. No new test cases are added because all current subset ops were
already supported previously. From this perspective, this change is NFC.

A new interface method (and a helper method) are added to
`SubsetInsertionOpInterface` to build the subset of the destination
tensor.
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
…face (llvm#65766)

This commit generalizes empty tensor elimination to operate on subset
ops. No new test cases are added because all current subset ops were
already supported previously. From this perspective, this change is NFC.

A new interface method (and a helper method) are added to
`SubsetInsertionOpInterface` to build the subset of the destination
tensor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:bufferization Bufferization infrastructure mlir:core MLIR Core Infrastructure mlir:tensor mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants