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

[FIRRTL] Refactor class lowering to avoid unnecessary cloning #7823

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

mikeurbach
Copy link
Contributor

Simplify the class lowering logic by directly moving or cloning operations
instead of cloning the entire module body. This change:

  • Removes the need to clone the entire module region
  • Only clones instance operations that need to be preserved
  • Directly moves property operations to the OM class
  • Removes redundant block cleanup

mikeurbach and others added 2 commits November 14, 2024 13:39
Simplify the class lowering logic by directly moving or cloning operations
instead of cloning the entire module body. This change:

- Removes the need to clone the entire module region
- Only clones instance operations that need to be preserved
- Directly moves property operations to the OM class
- Removes redundant block cleanup
@mikeurbach mikeurbach merged commit 2fd0b29 into main Nov 15, 2024
4 checks passed
@mikeurbach mikeurbach deleted the dev/hidetou/lower-classes-perf-2 branch November 15, 2024 21:54
Comment on lines +1242 to +1249
for (auto &op :
llvm::make_early_inc_range(llvm::reverse(moduleLike.getOperation()
->getRegion(0)
.getBlocks()
.front()
.getOperations())))
if (isPropertyOp(op) && !isa<InstanceOp>(op))
op.erase();
Copy link
Member

Choose a reason for hiding this comment

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

Just making sure, is there anything to erase in the original module, since we're moving all the property operations?

Copy link
Member

Choose a reason for hiding this comment

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

Good point, I think this is dead code now.

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