-
Notifications
You must be signed in to change notification settings - Fork 177
Conversation
Makes sense, and several transforms will error or fail to terminate if they are run on a circuit violating this constraint, so |
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. One small question: why 'N'TypeMap?
type TypeMap = collection.mutable.LinkedHashMap[String, Type] | ||
|
||
private type NTypeMap = collection.mutable.HashMap[String, Type] |
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.
Why the 'N'? This holds the types for all declared components, not just nodes.
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.
N
was for "new", should I rename it to make it more clear?
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 guess? I guess it doesn't really matter.
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'll make it `New, it's 2 whole more characters and if it confused you now it'll confuse people later (myself included lol)
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 renamed it to TypeLookup
@albert-magyar should I backport this to |
I think 1.2.x. Both changes are just really simple and solid. |
4647e4c
to
7ad1549
Compare
Do the same in CInferTypes
7ad1549
to
26693f7
Compare
A couple of minor improvements to performance of InferTypes and CInferTypes.
I've marked this for backporting but I did the deprecation warnings assuming it won't be included in the 1.3.1 release tomorrow.
The reason the traversal was redundant in
DefNode
was that it already mapped on its expression to get the type of the node itself. Due to declaration before use requirements, the node itself cannot be used in it's RHS.Benchmarks results
In a normal compilation of FIRRTL, InferTypes is run 6 times and CInferTypes is run once.
Full compiler run
JMH Results of LowerTypes
Contributor Checklist
Type of Improvement
API Impact
Deprecates type aliases in
InferTypes
andCInferTypes
Backend Code Generation Impact
None
Desired Merge Strategy
Release Notes
Improve performance of InferTypes and CInferTypes
Reviewer Checklist (only modified by reviewer)
Please Merge
?