Uh oh!
There was an error while loading. Please reload this page.
JIT: Switch tailcall implicit byref optimization to use last use information - #81033
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. Fixdotnet#81019
ghost
commented
Jan 23, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThe last use information is more general in most cases (for example, the Fix #81019
|
jakobbotsch
commented
Jan 23, 2023
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. Fixdotnet#81081
|
jakobbotsch
commented
Jan 25, 2023
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. |
jakobbotsch
commented
Jan 27, 2023
Ping @AndyAyersMS |
AndyAyersMS
left a comment
There was a problem hiding this comment.
LGTM.
Sorry to see all that fabulous alias analysis get deleted, but this approach is better and more obviously correct.
jakobbotsch
commented
Jan 27, 2023
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