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] Run canonicalizer again after IMCP #7796

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

rwy7
Copy link
Contributor

@rwy7 rwy7 commented Nov 11, 2024

IMCP propagates constants across modules, which should enable more
canonicalization. However, lower-layers, which runs between IMCP and
canonicalization, takes layerblocks and outlines them into their own module.
This effectively undoes the work of IMCP, and prevents us from canonicalizing
as well as we should under layers. This PR adds an additional run of the canonicalizer
immediately after the second run of IMCP, so that we have a better shot at
canonicalization.

In particular, we want to ensure that we are able to canonicalize away dead
assertions and assumptions under layerblocks.

@rwy7 rwy7 added the FIRRTL Involving the `firrtl` dialect label Nov 11, 2024
@rwy7 rwy7 changed the title [firtool] Run layer merge after inliner [FIRRTL] Run canonicalizer again after IMCP Nov 11, 2024
IMCP propagates constants across modules, which should enable more
canonicalization.  However, lower-layers, which runs between IMCP and
canonicalization, takes layerblocks and outlines them into their own module,
which effectively undoes the work of IMCP, and prevents us from canonicalizing
as well as we should under layers. This PR runs the canonicalizer immediately
after IMCP, so that we have a better shot at canonicalization.

In particular, we want to ensure that we are able to canonicalize away dead
assertions and assumptions under layerblocks.
@rwy7 rwy7 marked this pull request as ready for review November 11, 2024 23:24
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

@rwy7 rwy7 merged commit ed7f9da into llvm:main Nov 12, 2024
4 checks passed
@rwy7 rwy7 deleted the canonicalize-after-imcp branch November 12, 2024 20:26
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