-
Notifications
You must be signed in to change notification settings - Fork 178
Add missing ResolveKinds/ResolveFlows invalidates #1760
base: master-deprecated
Are you sure you want to change the base?
Conversation
32c6252
to
1cf3321
Compare
Update the dependencies of transforms which empirically invalidate ResolveKinds or ResolveFlows. This was discovered with some to-be-committed work that automates looking for incorrect transform dependencies. Specifically, the deficient transforms were found to not invalidate ResolveKinds or ResolveFlows, yet running ReslveKinds or ResolveFlows after these transforms would result in modifications to the circuit. The LoweringCompilersSpec was updated with patches to indicate the location of these new transforms. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
1cf3321
to
f5e7c2e
Compare
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.
Maybe you can see if the FlattenReg pass is easy to fix.
Alternatively I could give that a shot in a follow on PR once your testing setup is available to everyone.
@@ -133,7 +134,7 @@ class FlattenRegUpdate extends Transform with DependencyAPIMigration { | |||
override def optionalPrerequisiteOf = Seq.empty | |||
|
|||
override def invalidates(a: Transform): Boolean = a match { | |||
case _: DeadCodeElimination => true | |||
case _: DeadCodeElimination | ResolveKinds => true |
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.
This can probably be fixed by adding the correct kind (RegKind
) to the WRef
created on line 100.
@@ -53,7 +53,7 @@ class DeadCodeElimination extends Transform | |||
Dependency(passes.VerilogPrep), | |||
Dependency[firrtl.AddDescriptionNodes] ) | |||
|
|||
override def invalidates(a: Transform) = false | |||
override def invalidates(a: Transform) = a == ResolveKinds |
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.
Do you know if this had anything todo with the use of ExprKind
instead of MemKind
on line 134?
@@ -175,7 +175,7 @@ object VerilogMemDelays extends Pass { | |||
Dependency[SystemVerilogEmitter] ) | |||
|
|||
override def invalidates(a: Transform): Boolean = a match { | |||
case _: transforms.ConstantPropagation | ResolveFlows => true | |||
case _: transforms.ConstantPropagation | ResolveFlows | ResolveKinds => true |
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.
This one is interesting because the one WRef
it seems to create actually appears to have the correct kind (RegKind
).
Update the dependencies of transforms which empirically invalidate
ResolveKinds or ResolveFlows.
This was discovered with some to-be-committed work that automates
looking for incorrect transform dependencies. Specifically, the
deficient transforms were found to not invalidate ResolveKinds or
ResolveFlows, yet running ReslveKinds or ResolveFlows after these
transforms would result in modifications to the circuit.
The LoweringCompilersSpec was updated with patches to indicate the
location of these new transforms.
Depends on: [#1753, #1754]
This should be backported to 1.3.x, but will need to be done manually.
Contributor Checklist
Type of Improvement
API Impact
None.
Backend Code Generation Impact
None.
Desired Merge Strategy
Release Notes
None.
Reviewer Checklist (only modified by reviewer)
Please Merge
?