Skip to content
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

[LowerClasses] Stop cloning operations one at a time, NFCI. #7822

Closed
wants to merge 1 commit into from

Conversation

mikeurbach
Copy link
Contributor

The previous implementation would clone operations from the original module-like body to the new OM class body one at a time, maintaining an IRMapping as it went. This becomes a pretty bad performance bottleneck as the IR size increases, and the DenseMap within IRMapping starts to dominate.

Instead, this clones the entire region wholesale, and splices the body into the new OM class op. It then traverses both the original module-like and the OM class op to clean up each side: removing property ops from the module-like, and removing non-property ops from the OM class op.

This should be a non-functional change, but should dramatically help with scalability of this pass.

The previous implementation would clone operations from the original
module-like body to the new OM class body one at a time, maintaining
an IRMapping as it went. This becomes a pretty bad performance
bottleneck as the IR size increases, and the DenseMap within IRMapping
starts to dominate.

Instead, this clones the entire region wholesale, and splices the body
into the new OM class op. It then traverses both the original
module-like and the OM class op to clean up each side: removing
property ops from the module-like, and removing non-property ops from
the OM class op.

This should be a non-functional change, but should dramatically help
with scalability of this pass.
@mikeurbach
Copy link
Contributor Author

Will close this in favor of #7823

@mikeurbach mikeurbach closed this Nov 15, 2024
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.

1 participant