-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: Use edge weights in LinearScan::findPredBlockForLiveIn
#108493
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
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
LinearScan::findPredBlockForLiveIn
LinearScan::findPredBlockForLiveIn
cc @dotnet/jit-contrib, @kunalspathak PTAL. Diffs differ quite a bit by platform, though this looks like a PerfScore win most of the time. The last |
This sounds reasonable to me. Do we know why we do not see asmdiffs for win/x64, etc.? |
I'm guessing I kicked this run off too early, before all of the collections had propagated. Newer runs seem back to normal, so I'll kick another one off now. |
FWIW I merged a PR that updated the GUID yesterday (#108153) so maybe some of the new collection runs failed? I should have a new asp.net collection soonish. |
I was thinking that might be the case, but the SPMI diffs run from one of my other PRs with the updated GUID had collections for every platform, and the latest run on this PR is still missing collections... |
@kunalspathak @AndyAyersMS here are the diffs on win-x64 and win-arm64: gist. The arm64 diffs are smaller overall, as I had to skip some collections due to them stalling during asmdiffs on my machine (they didn't stall when replaying them, so this doesn't seem to be a JIT issue...). |
Seems odd though... |
Looks like you slotted this this "after" the critical edge avoidance heuristic. I wonder if it's better to use the edge weight heuristics there as well... if the "critical" edge is low weight then seems like we'd prefer to split it and put resolution moves there (that is, it seems like we could build a cost model of sorts and decide which we prefer, the unique pred or the "other pred"). |
Unrelated to the recent LSRA block order changes, but I noticed that for blocks with multiple predecessors,
LinearScan::findPredBlockForLiveIn
picks the predecessor with the largest block weight to get the current block's live-in variable register locations from. It would be more precise to factor in the predecessor edges' likelihoods, too -- for example, if one predecessor block is marginally heavier than the other, but is far less likely to flow into their shared successor, the latter seems like a better choice.Diffs were a mixed bag locally, though now that we always have edge likelihoods available, this seems like something we should be doing on principle.