-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: Switch tailcall implicit byref optimization to use last use information #81033
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
…rmation The last use information is more general in most cases (for example, the old logic cannot allow the optimization when there are previous field writes to the implicit byref). In addition the old logic can interact with the new last-use copy elision optimization in an incorrect way. Fix dotnet#81019
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThe last use information is more general in most cases (for example, the Fix #81019
|
SuperPMI jobs seemingly did not trigger..? |
The zeroing that the tailcall-to-loop optimization does was zeroing the promoted copies implicit byrefs even when promotion of them was undone. This was introducing unexpected references to the promoted fields. Fix dotnet#81081
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS Diffs. The new misses are tailcall candidates (that hit a new The regressions are in similar situations as the case inside #81019 -- i.e. the old logic prefers omitting the copy at some non-last use because it believes a subsequent use won't alias. That allows tailcalling, so it is usually better, but the case is quite rare as can be seen in the diffs. |
Ping @AndyAyersMS |
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.
LGTM.
Sorry to see all that fabulous alias analysis get deleted, but this approach is better and more obviously correct.
Yes, I felt both good and bad removing that code... :-) |
The last use information is more general in most cases (for example, the
old logic cannot allow the optimization when there are previous field
writes to the implicit byref). In addition the old logic can interact
with the new last-use copy elision optimization in an incorrect way.
Fix #81019