-
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
Consider reloadWeight while evaluating spill cost #53853
Conversation
Below are diffs of benchmarks/ libraries on following configuration:
I have collected 4 metrics to get a sense of this change:
While there are minor CodeSize regression, the perfScore benefis greatly, specially for windows x64, both on libraries and benchmarks. For certain configurations (e.g. Linux x64), the total PerfScore shows regression, but relative perf score has improvement which I take as improvement. For x86, the improvements are smaller and spills are little more because of register pressure, but overall libraries PerfScore still looks great. Even for benchmarks, the relative perf score shows improvement. Detail diffsBenchmarks.run.Linux.x64.checked
Detail diffs
Detail diffs
Detail diffs
Benchmarks.run.windows.arm64.checked
Detail diffs
Detail diffs
Detail diffs
Benchmarks.run.windows.x64.checked
Detail diffs
Detail diffs
Detail diffs
Benchmarks.run.windows.x86.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.Linux.arm.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.Linux.arm64.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.Linux.x64.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.windows.arm64.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.windows.x64.checked
Detail diffs
Detail diffs
Detail diffs
Libraries.pmi.windows.x86.checked
Detail diffs
Detail diffs
Detail diffs
|
Failing |
@dotnet/jit-contrib |
Hello @kunalspathak! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
I verified the windows-arm64 failures and it looks to be an infrastructure issue. I verified the console logs using kustos and they seems to be passing. |
In
SPILL_COST
heuristics, we always check the spill cost ofrecentRefPosition
(last ref position) where the register was allocated. Spill cost is essentially the ref count weight of a variable. However, later, we check if thatrecentRefPosition
is notRegOptional
and is actual ref. If it is not, we skip spill it at therecentRefPosition
and would instead reload at the nextrefPosition
. As such, when calculating the spill cost, we should take that factor into account and depending on if we we will spill at last location or reload at next location, take the cost of appropriate position.Here is the sample diff:
Note below, that we spill a low weight variable on stack in favor of using register for higher weight variable.
Fixes: #53703
Related: #52316