Fix depth-preserving rewrite and depth view#691
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #691 +/- ##
==========================================
+ Coverage 83.83% 84.21% +0.38%
==========================================
Files 189 189
Lines 29888 29068 -820
==========================================
- Hits 25056 24481 -575
+ Misses 4832 4587 -245 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
More extensive fix for #687.
Depth view now has public helper functions to compute the node level and required level using the given cost function.
I considered adding ALAP (#555) to depth view, but its recursion seems less efficient than reverse topological order traversal using topo view.
Level update is now first attempted by recurring the fanouts, and when it finds reconvergence, it falls back on topological order traversal from the sink nodes, collected by a couple of fanin/fanout recursions. I hope this is not too bad for performance.
Required level computation now records required levels of new nodes. This greatly helps runtime for MIG rewrite from AIGs of arithmetic functions (e.g., multiplier.aig). Didn't look into detailed profiles, but I guess creating many new nodes in the reconvergence regions caused the problem, requiring multiple traversals through them.
One note is that the current (and previous) required level computation is quite conservative. Update happens only when the previous required level is looser. For exact update, we need to check all fanouts, and the recursive approach will likely encounter performance issue. We may do something similar to what I did for level computation here. Or there may be a cleverer way by maintaining a topological order throughout optimization. I'll leave it for now.