-
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
PGO: Static profile affects loop alignment where it's not supposed to do #71649
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsExtracted from dotnet/performance: private static uint[] input_uint = Enumerable.Range(0, 1000).Select(i => (uint)i).ToArray();
[MethodImpl(MethodImplOptions.NoInlining)]
public int TrailingZeroCount_uint()
{
int sum = 0;
uint[] input = input_uint;
for (int i = 0; i < input.Length; i++)
sum += BitOperations.TrailingZeroCount(input[i]);
return sum;
} Codegen diff: https://www.diffchecker.com/dIVV1Iwy My theory that when we collect the profile for
|
cc @AndyAyersMS I think you might find this issue curious too, somehow static pgo marks loop body "cold" or rather not hot enough. Weights with ReadyToRun=1 (using StandardOptimization.mibc):
Weights for
|
I assume it's that general problem of propagating weights from profiled inlinees to non-profiled callee. |
Extracted from dotnet/performance:
Codegen diff: https://www.diffchecker.com/dIVV1Iwy
Left:
ReadyToRun=1
, Right:ReadyToRun=0
My theory that when we collect the profile forTrailingZeroCount
we don't have BMI on that machine so it messes weights up which then inmported into this loop and mark it as non-profitable to align.mibc dump:
Hm.. however, looks like MIBC is correct for
BitOperations.TrailingZeroCount
,"ILOffset": 7
stands forThe text was updated successfully, but these errors were encountered: