-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][bufferization] Return BufferLikeType in BufferizableOpInterface #144867
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,7 +222,7 @@ AliasingValueList AllocTensorOp::getAliasingValues(OpOperand &opOperand, | |
return {}; | ||
} | ||
|
||
FailureOr<BaseMemRefType> | ||
FailureOr<BufferLikeType> | ||
AllocTensorOp::getBufferType(Value value, const BufferizationOptions &options, | ||
const BufferizationState &state, | ||
SmallVector<Value> &invocationStack) { | ||
|
@@ -245,7 +245,8 @@ AllocTensorOp::getBufferType(Value value, const BufferizationOptions &options, | |
return getOperation()->emitError("could not infer memory space"); | ||
} | ||
|
||
return getMemRefTypeWithStaticIdentityLayout(getType(), memorySpace); | ||
return cast<BufferLikeType>( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: unfortunately, i didn't seem to manage to avoid this even with an addition of an implicit ctor (tried locally but didn't add it in this patch): |
||
getMemRefTypeWithStaticIdentityLayout(getType(), memorySpace)); | ||
} | ||
|
||
LogicalResult AllocTensorOp::verify() { | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getMemorySpace()
is the main problem here why I couldn't dropbufferization::detail::asMemRefType()
(and thus work with BufferLikeType objects directly).@matthias-springer is it reasonable to assume all buffers have an associated memory space? I guess I could follow this up by another patch that extends the BufferLikeType and streamlines multiple places around the code-base.