-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
constprop: Add facility for widening arguments before constprop #54036
Conversation
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.
It could be a valuable move to use WidenedArgtypes
for boosting cache hits when there are unused arguments. Should I go ahead and try implementing it (maybe it not be that simple as it likely requires something like EA though)?
There are various situations where we may want to constprop with something other than the most precise concrete arguments in order to make the resulting cache more useful to other call sites. One particular example of this might be a method where non-concrete inference already discovered that one argument is unused: ``` function foo(a, b::DispatchOnly) expensive_to_compile(a) end ``` Right now, we will generally perform constprop for every different value of `b`, even though we already have the information that `b` is unused. Another example is external absints that may want to treat certain types fully symbolically. They may want to substitute concrete values for an abstract domain. This adds the facility to do both of these things by 1. Adding an appropriate interp hook in the constprop path 2. Adding a WidendedSimpleArgtypes wrapper that's like SimpleArgtypes but works around an issue where we would override cache information using values from concrete eval, which is not legal if the argtypes were widened.
694efe8
to
1d2caf5
Compare
Yes, that's the natural extension of this PR - I just didn't try it yet. I think EA may compute it as it goes, but yeah, it's not quite the same analysis. |
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
This commit implements the idea concept suggested in #54036 to stop constant propagation for unused arguments. There are still some tasks to complete, but I've turned it into a PR to facilitate benchmarking. The pending tasks are as follows: - [ ] incorporate used-ness information derived from abstract interpretation (this will address the `@test_broken` that is being added by this commit) - [ ] apply `WidenedArgtypes` appropriately
There are various situations where we may want to constprop with something other than the most precise concrete arguments in order to make the resulting cache more useful to other call sites. One particular example of this might be a method where non-concrete inference already discovered that one argument is unused:
Right now, we will generally perform constprop for every different value of
b
, even though we already have the information thatb
is unused.Another example is external absints that may want to treat certain types fully symbolically. They may want to substitute concrete values for an abstract domain.
This adds the facility to do both of these things by