-
Notifications
You must be signed in to change notification settings - Fork 572
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
Avoid emitting 'const const' for const vecs of const elements #3393
Conversation
I realize now I need to handle vecs of vecs where the intermediate vec isn’t const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The PR needs a label for the release generation flow. Could you do two things:
- Add the label. Probably "Codegen"
- Populate the "Release Notes" section of the PR template.
Jack wrote some cool automation to use these two things to automatically generate the release notes.
I added the release notes. I don't believe I'm able to add a label (I'm not a member of this repo) unless I'm missing something. |
case ConstType(underlying: Type) => { | ||
// Avoid emitting multiple consecurive 'const', which can otherwise occur for const vectors of const elements | ||
if (!lastEmittedConst) { | ||
b ++= "const " | ||
} | ||
s(underlying, true)(b, indent) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm of two minds about this solution. I'm a bit concerned because this same issue is solved for directions in the Converter (
private def firrtlUserDirOf(d: Data): SpecifiedDirection = d match { |
Better yet would be if we could pull the fix further up into the actual construction of the Chisel types such that these fixups aren't necessary.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Multiple consecutive 'const' modifiers are no longer emitted when emitting a const vector of const elements.
Reviewer Checklist (only modified by reviewer)
3.5.x
or3.6.x
depending on impact, API modification or big change:5.0.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.