-
Notifications
You must be signed in to change notification settings - Fork 248
compiler: Turn aliases' choose() into an instance method #2839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2839 +/- ##
==========================================
- Coverage 78.94% 78.94% -0.01%
==========================================
Files 248 248
Lines 50877 50877
Branches 4394 4394
==========================================
- Hits 40167 40163 -4
- Misses 9912 9915 +3
- Partials 798 799 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
EdCaunt
left a comment
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.
Approving as this pretty much just moves stuff around, even if there are changes that I would personally consider
| # Project the candidate aliases into `exprs` to derive the final | ||
| # working set | ||
| mapper = {k: v for k, v in mapper.items() | ||
| if v.free_symbols & set(aliases.aliaseds)} |
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.
set(aliases.aliaseds) is known before creating this mapper and will be the same for every iteration of the list comprehension. I would maybe pull it out of the list comprehension?
| # `score > M` => optimized | ||
| # `m <= score <= M` => maybe optimized, depends on heuristics | ||
| m = self.opt_mingain | ||
| M = self.opt_mingain*3 |
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 3? Is it just a magic number?
| owset = wset(templated) | ||
|
|
||
| # Filter off the aliases with a weak flop-reduction / working-set tradeoff | ||
| key = lambda a: \ |
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 this wants to be an actual function rather than a lambda - it's pretty unreadable
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.
Ah, just saw that all this is just lifted from elsewhere. I think the point still stands even if it's not so pressing
|
all your points do make sense as explained offline, we should revamp this module at some point in the future |
No description provided.