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] LowerToHW: guard against folded operations (#7358) (backport) #7590

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

dtzSiFive
Copy link
Contributor

@dtzSiFive dtzSiFive commented Sep 6, 2024

In LowerToHW we copy the name from FIRRTL ops to the lowered HW ops. We often call createOrFold when creating the HW ops, which can mean that there is no operation to copy the name to. We were not properly detecting this scenario, which could cause us to try to copy the name to a null operation. Most ops were already covered under a guard in a generic code path, but div-like and subaccess-like operations needed to be guarded. Some of these problems are impossible to test right now as we require folders to be implemented for some operations.

This backports #7358 to 1.62.0 for Chisel 6 users.

In LowerToHW we copy the name from FIRRTL ops to the lowered HW ops.  We
often call `createOrFold` when creating the HW ops, which can mean that
there is no operation to copy the name to.  We were not properly
detecting this scenario, which could cause us to try to copy the name to
a null operation.  Most ops were already covered under a guard in a
generic code path, but div-like and subaccess-like operations needed to
be guarded.  Some of these problems are impossible to test right now as
we require folders to be implemented for some operations.
@dtzSiFive dtzSiFive merged commit ba60dce into llvm:firtool-1.62 Sep 6, 2024
4 checks passed
@dtzSiFive dtzSiFive deleted the backport/1.62.0-7358 branch September 6, 2024 18:19
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.

3 participants