-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[mlir] Add symbol user attribute interface. #153206
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 3 commits
5b317ea
bd0bd41
3855fd5
2fec0b1
d3bdf89
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 | ||||
---|---|---|---|---|---|---|
|
@@ -511,7 +511,14 @@ LogicalResult detail::verifySymbolTable(Operation *op) { | |||||
SymbolTableCollection symbolTable; | ||||||
auto verifySymbolUserFn = [&](Operation *op) -> std::optional<WalkResult> { | ||||||
if (SymbolUserOpInterface user = dyn_cast<SymbolUserOpInterface>(op)) | ||||||
return WalkResult(user.verifySymbolUses(symbolTable)); | ||||||
if (failed(user.verifySymbolUses(symbolTable))) | ||||||
return WalkResult::interrupt(); | ||||||
for (auto &attr : op->getAttrs()) { | ||||||
|
for (auto &attr : op->getAttrs()) { | |
for (auto &attr : op->getDiscardableAttrs()) { |
As we're splitting properties and attributes, I don't think we need more dependencies here!
But that also question the usefulness of this and how it'll work in practice: I assume an attribue that is part of the properties would also want to be verified.
However that should be handled through the SymbolUserOpInterface (which may just have to forward to the attribute).
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.
I think this is a big open:
But that also question the usefulness of this and how it'll work in practice: I assume an attribue that is part of the properties would also want to be verified.
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.
Properties are bits that only has meaning for an operation today. There is no generic interpretation. If properties had interfaces, then one could query an interface here in the same way. I see this not as inhibiting nor prerequisite here. And indeed today the only way would be via SymbolUserOpInterface, one could additionally factor out common function C++ side that could be used in both.
In practice, this is very useful for composition between dialects where one isn't the sole owner. I have a few pipelines where this would be used where the alternatives require coupling, rearchitecting, some interface injection (which doesn't quite work), doing a bit of silly additions of attributes/adding registries or just having a worse error & debugging experience. So just covering discardable attributes suffices in improving error localization sufficiently for such cases.
Uh oh!
There was an error while loading. Please reload this page.