-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][bufferization] Don't clone on unknown ownership and verify function boundary ABI #66626
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
Conversation
@llvm/pr-subscribers-mlir-cf @llvm/pr-subscribers-mlir-tensor ChangesAdds a pass option to the Depends on #66619
|
ab01756
to
1647897
Compare
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.td
Show resolved
Hide resolved
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.td
Outdated
Show resolved
Hide resolved
mlir/lib/Dialect/Bufferization/IR/BufferDeallocationOpInterface.cpp
Outdated
Show resolved
Hide resolved
1647897
to
9bda5e8
Compare
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.h
Outdated
Show resolved
Hide resolved
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.td
Outdated
Show resolved
Hide resolved
mlir/include/mlir/Dialect/Bufferization/IR/BufferDeallocationOpInterface.h
Show resolved
Hide resolved
mlir/lib/Dialect/Bufferization/IR/BufferDeallocationOpInterface.cpp
Outdated
Show resolved
Hide resolved
mlir/lib/Dialect/Bufferization/IR/BufferDeallocationOpInterface.cpp
Outdated
Show resolved
Hide resolved
…ction boundary ABI Inserting clones requires a lot of assumptions to hold on the input IR, e.g., all writes to a buffer need to dominate all reads. This is not guaranteed by one-shot bufferization and isn't easy to verify, thus it could quickly lead to incorrect results that are hard to debug. This commit changes the mechanism of how an ownership indicator is materialized when there is not already a unique ownership present. Additionally, we don't create copies of returned memrefs anymore when we don't have ownership. Instead, we insert assert operations to make sure we have ownership at runtime, or otherwise report to the user that correctness could not be guaranteed.
1675d91
to
5b0f67b
Compare
…ction boundary ABI (llvm#66626) Inserting clones requires a lot of assumptions to hold on the input IR, e.g., all writes to a buffer need to dominate all reads. This is not guaranteed by one-shot bufferization and isn't easy to verify, thus it could quickly lead to incorrect results that are hard to debug. This commit changes the mechanism of how an ownership indicator is materialized when there is not already a unique ownership present. Additionally, we don't create copies of returned memrefs anymore when we don't have ownership. Instead, we insert assert operations to make sure we have ownership at runtime, or otherwise report to the user that correctness could not be guaranteed.
…rify function boundary ABI (llvm#66626)" This reverts commit aa9eb47. It introduced a double free in a test case. Reverting to have some time for fixing this and relanding later.
Hi! |
Inserting clones requires a lot of assumptions to hold on the input IR, e.g.,
all writes to a buffer need to dominate all reads. This is not guaranteed by
one-shot bufferization and isn't easy to verify, thus it could quickly lead to
incorrect results that are hard to debug. This commit changes the mechanism of
how an ownership indicator is materialized when there is not already a unique
ownership present. Additionally, we don't create copies of returned memrefs
anymore when we don't have ownership. Instead, we insert assert operations to
make sure we have ownership at runtime, or otherwise report to the user that
correctness could not be guaranteed.