-
Notifications
You must be signed in to change notification settings - Fork 171
[CIR][NFC] Add cir::CallOp
method to get called function
#1892
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?
Conversation
/// If this is a direct call, returns the callee as a `cir::FuncOp` in parent `module`. | ||
/// Otherwise, returns `null`. | ||
/// NOTE: This method walks the symbol table. If you are calling this method a lot, | ||
/// consider using `cir::FuncOp::getDirectCallee(mlir::SymbolTable &)` instead. |
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.
How would you make such a change? All of the uses in this PR use the other form.
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.
If you know youre going to query this a lot, you'd run the mlir::SymbolTableAnalysis
and use its result for repeated queries.
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.
Probably not a good use for CIRGen though, given the symbol table is constantly changing
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.
mlir::SymbolTableAnalysis
claims to be good at handling insertions and removals. I looked through CIRGen though and couldn't find anywhere that this API could be used.
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.
@andykaylor does that answer your question? Or would you prefer me to remove the symbol table methods until we have a user?
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.
LGTM once Andy comments/questions are addressed!
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.
lgtm
f393a2d
to
9d5e477
Compare
Rebased after the latest reverts. CI is green |
No description provided.