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

[firtool] Run CSE on classes #7814

Merged
merged 1 commit into from
Nov 14, 2024
Merged

[firtool] Run CSE on classes #7814

merged 1 commit into from
Nov 14, 2024

Conversation

youngar
Copy link
Member

@youngar youngar commented Nov 14, 2024

This runs CSE on all operations underneath the circuit. This also moves it up before the rest of the FModule passes run, as the Any pipeline will not merge with them.

This runs CSE on all operations underneath the circuit. This also moves
it up before the rest of the FModule passes run, as the Any pipeline
will not merge with them.
@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Nov 14, 2024
Comment on lines -68 to -70
if (!opt.shouldDisableOptimization())
pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
mlir::createCSEPass());
Copy link
Member

Choose a reason for hiding this comment

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

Is there any benefit in running twice or keeping this here to run on FModuleOp? Or: is CSE blocked on things with different names / does DropNames expose work for CSE?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be OK I think. CSE will only remove the ops marked Pure, and anything FNamable is not Pure.

@youngar youngar merged commit f71d0fb into llvm:main Nov 14, 2024
4 checks passed
@youngar youngar deleted the firrtl-cse-class branch November 14, 2024 07:51
@youngar
Copy link
Member Author

youngar commented Nov 14, 2024

@uenoku I merged this as is, but I agree with what you said offline: it seems like it would be a great idea to push this as far to the front of the pipeline as we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants