-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix inference of split_rest
#47329
fix inference of split_rest
#47329
Conversation
Just to copy a comment over from the other PR: I wonder if this aggressive constprop might be better to have directly in the lowering, if possible, such that it applies to all cases of |
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.
Good catch!
We really can't generally transform |
What I mean is - since it already lowers like below, would it be possible to somehow say "constprop the
|
Co-authored-by: Jakob Nissen <[email protected]>
So you basically want to annotate |
I had the latter in mind, but don't know if it's technically feasible. |
I'm not sure we actually want that, since I'd expect aggressive constant prop to only really be useful in the case of statically sized iterators. Seems better to only annotate this for specific methods where we know it's profitable. What I would've hoped though is that inference's constant prop heuristic were able to deduct profitability of constant prop here. Perhaps the issue is that tuple slicing has a bunch of hard-coded if-statements, causing the code to be considered too complicated for this? |
fixes #47326