Skip to content

Conversation

tommymcm
Copy link
Collaborator

@tommymcm tommymcm commented Sep 5, 2025

No description provided.

/// 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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Member

@bcardosolopes bcardosolopes Sep 5, 2025

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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?

Copy link
Member

@bcardosolopes bcardosolopes left a 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!

Copy link
Collaborator

@xlauko xlauko left a comment

Choose a reason for hiding this comment

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

lgtm

@tommymcm
Copy link
Collaborator Author

tommymcm commented Sep 8, 2025

Rebased after the latest reverts. CI is green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants