Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

AndyAyersMS
Copy link
Member

If we are doing an optimized+instrumented jit pass (like we do for R2R methods) allow the inlinees to be instrumented. This gives us a chance to collect profile data for methods that are always inlined.

All inlinees currently share the same profile data segment with each other and with a root compilation of the method (if any). So this profile is "context-free".

If there is a schema mismatch (say there is a stale pre-existing R2R schema) then subsequent instrumentation will fail. This is something we need to keep an eye on. Right now we can't distinguish this failure from other kinds of schema allocation failures.

Closes #44372

If we are doing an optimized+instrumented jit pass (like we do for R2R methods)
allow the inlinees to be instrumented. This gives us a chance to collect profile
data for methods that are always inlined.

All inlinees currently share the same profile data segment with each other and
with a root compilation of the method (if any). So this profile is "context-free".

If there is a schema mismatch (say there is a stale pre-existing R2R schema) then
subsequent instrumentation will fail. This is something we need to keep an eye on.
Right now we can't distinguish this failure from other kinds of schema allocation
failures.

Closes dotnet#44372
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 12, 2025
@AndyAyersMS
Copy link
Member Author

AndyAyersMS commented Sep 12, 2025

This should address the long-standing regression in #91938. Local runs show it possibly helps but doesn't completely fix the regression. Still need to verify it is actually getting instrumentation data for the key inlinees.

Generally speaking, this should help reduce the gap between running with R2R enabled (where we can lose profile data, or optimize based on stale data) and R2R disabled.

@AndyAyersMS
Copy link
Member Author

I have a bunch more fixes on top of this, will PR them soon.

One issue I'm seeing is IL mismatches. Some of it I've tracked down to IL differences between the PGO schema embedded into corelib and the current corelib IL; that's somewhat understandable as the PGO data likely goes stale, and should be (generally) a non-product issue.

Would still be good to flag this case and allow the dynamic PGO to take over.

I also suspect inlinee schemas may diverge from root schemas even for the same IL, but need to do more work to track this down.

@AndyAyersMS
Copy link
Member Author

Still some failures to sort out. Also my local perf runs aren't as promising as I'd hoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support profile instrumentation for inlinees
1 participant