-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: Enable cross-block local assertion prop for natural loops #101763
Conversation
For natural loop headers we can allow propagating assertions from the entering predecessors without intersecting them with the assertions from the backedges, provided that we take care to kill all assertions about locals that may be defined within the loop. We can pay a bit of TP to compute this set before morph. This is a similar to what VN does for natural loops, just less general.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
This should effectively subsume what #90622 was doing. But let's see what the throughput cost is. |
FYI @AndyAyersMS... Diffs: https://dev.azure.com/dnceng-public/public/_build/results?buildId=661917&view=ms.vss-build-web.run-extensions-tab I think most of the cost here comes from finding loops, but we might be able to get more mileage out of that, for example by using it to do loop inversion instead of the existing lexical approach. I'm a bit more concerned about the diffs themselves... they seem very mixed, and the perfscore diffs are mostly regressions. |
We saw this with the cross-block work too, I suspect the main culprit is simplistic copy prop not realizing when it is creating overlapping lifetimes. Aggressive forwarding of constants should mostly lead to good diffs though. |
And yes it would be nice to have a non-lexical approach to inversion. |
The detailed TP breakdown for
So looks like most of the cost actually comes from the new copy prop that is enabled. Loop finding and finding the definitions inside the loops looks quite cheap. |
Diffs still seem pretty mixed, even with copy assertions removed. Odd. |
My experience with assertprop changes is that we fairly often hit the limit of assertions allowed per method, so if you enable more assertions there is risk that some more useful assertions won't be added |
Local assertion prop scales up the table size differently than global, since we're not solving a global dataflow problem. We should metric-ify |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
For natural loop headers we can allow propagating assertions from the entering predecessors without intersecting them with the assertions from the backedges, provided that we take care to kill all assertions about locals that may be defined within the loop. We can pay a bit of TP to compute this set before morph.
This is a similar to what VN does for natural loops, just less general.