Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Add NoConstantPropagationAnnotation to disable constatnt propagation #2150

Merged
merged 4 commits into from
Mar 27, 2021

Conversation

sequencer
Copy link
Member

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you update the FIRRTL spec to include every new feature/behavior?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • new feature/API

API Impact

add

Backend Code Generation Impact

none

Desired Merge Strategy

  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

--no-constant-propagation can be used to disable constant propagation.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

src/main/scala/firrtl/stage/FirrtlAnnotations.scala Outdated Show resolved Hide resolved
new ShellOption[String](
longOption = "dont-fold",
toAnnotationSeq = a => {
PrimOps
.builtinPrimOps
.map(op => op.toString -> op)
.toMap
.get(a)
.orElse(throw new OptionsException(s"Unknown primop '$a'. (Did you misspell it?)"))
.map(DisableFold(_))
.toSeq
},
helpText = "Disable folding of specific primitive operations",
helpValueName = Some("<primop>")
)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I move that ShellOption to here, for better consistency.

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.

This is looking great, @sequencer!

I'm fine to merge this if we can get around the binary compatibility issue. I'd like this to get into 1.4.3 and not have to wait until 1.5.0 for this to show up. I'm also hesitant to waive binary compatibility checks for this.

src/main/scala/firrtl/stage/FirrtlAnnotations.scala Outdated Show resolved Hide resolved
@sequencer sequencer force-pushed the no_const_prop_anno branch 2 times, most recently from 233ccb5 to f58195c Compare March 25, 2021 22:39
@sequencer
Copy link
Member Author

Thanks @seldridge, I just rebased the binary incompatible part to #2152. I think this PR is safe to merge now.

@sequencer sequencer added the API Deprecation Changing the API but with proper deprecation label Mar 25, 2021
@jackkoenig jackkoenig added this to the 1.4.x milestone Mar 26, 2021
@jackkoenig jackkoenig added the Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI. label Mar 27, 2021
@mergify mergify bot merged commit abeff01 into master Mar 27, 2021
mergify bot pushed a commit that referenced this pull request Mar 27, 2021
…2150)

* add --no-constant-propagation to disable constant propagation

* add test

* deprecate DisableFold.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit abeff01)
@mergify mergify bot added the Backported This PR has been backported to marked stable branch label Mar 27, 2021
mergify bot added a commit that referenced this pull request Mar 27, 2021
…2150) (#2158)

* add --no-constant-propagation to disable constant propagation

* add test

* deprecate DisableFold.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit abeff01)

Co-authored-by: Jiuyang Liu <[email protected]>
@sequencer sequencer deleted the no_const_prop_anno branch April 29, 2021 04:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Deprecation Changing the API but with proper deprecation Backported This PR has been backported to marked stable branch Please Merge Accepted PRs that are ready to be merged. Useful when waiting on CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants