Optimize performance of Combinational.ssa
driver search
#443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description & Motivation
For sufficiently large and complex designs, a substantial performance penalty was paid for constructing
Combinational.ssa
due to the search algorithm for potential SSA drivers. The algorithm had to search backwards from inputs toConditional
s for potential SSA drivers. This was especially expensive when using thePipeline
abstraction, since that chained multipleCombinational.ssa
s together.This PR changes the algorithm to search outwards from SSA drivers to cache signals that are driven by it. This trades the performance glass jaws:
Combinational.ssa
, you could pay a performance penalty proportional to the size of that logicCombinational.ssa
construction, you could pay a performance penalty proportional to the size of that logic.The latter glass jaw should be substantially smaller, less likely, and less frequent.
This PR also adds a benchmark which demonstrates a large performance improvement in a somewhat good example of common use cases.
Related Issue(s)
N/A
Testing
Existing tests cover functionality, new benchmark covers performance
Backwards-compatibility
No
Documentation
No