Skip to content

Conversation

@fabianschuiki
Copy link
Contributor

This is a set of tweaks and improvements to reduction patterns as I've been debugging a few FIRRTL dedup and class lowering issues. I plan to land this using a rebase merge, not a squash merge, such that the individual independent commits stay separated.

Add the SimplifyResets reduction pattern, which converts all uninferred
resets into synchronous resets and removes any annotations involved in
the reset inference pass. This helps later reductions remove module
instances without the resets in those modules becoming uninferred.
Since deduplication of classes is being phased out, exclude
`firrtl.object` operations from dedup reductions.
Only force-dedup modules if their port signatures truly match. Also,
delay removal of modules until the very end. This allows the reduction
to deal with malformed input IR a bit better.
Instead of removing MustDedup annotations from parent modules once they
were applied to children, keep them around on parents as well. This
helps propagate MustDedup all the way to child modules even if the test
case relies on the parent module also being marked as dedup. Having
redundant MustDedup annos on child modules helps the ForceDedup
reduction collapse child modules to one definition, effectively applying
a partial dedup.
@fabianschuiki fabianschuiki added the FIRRTL Involving the `firrtl` dialect label Oct 23, 2025
@fabianschuiki
Copy link
Contributor Author

Landing this since it only touches circt-reduce.

@fabianschuiki fabianschuiki added the Reducer Related to `circt-reduce` label Oct 28, 2025
@fabianschuiki fabianschuiki merged commit f0910de into main Oct 28, 2025
7 checks passed
@fabianschuiki fabianschuiki deleted the fschuiki/reducer-tweaks branch October 28, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FIRRTL Involving the `firrtl` dialect Reducer Related to `circt-reduce`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants