Skip to content
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: Reduce number of block counters #81731

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Feb 7, 2023

Closes #81369

This PR:

  1. Disables block/edge instrumentation for single-block methods (see Redundant block counter in a single-block method  #81369 for an example)
  2. Removes some Prejit+instrumentation related flags - we don't support that any way
  3. Consolidate all possible configurations for block counting in a single config switch - JitBlockProfilingKind

Expecting some nice SPMI size & TP diffs in aspnet collection
cc @AndyAyersMS

@ghost ghost assigned EgorBo Feb 7, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 7, 2023
@ghost
Copy link

ghost commented Feb 7, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #81369

This PR:

  1. Disables block/edge instrumentation for single-block methods (see Redundant block counter in a single-block method  #81369 for an example)
  2. Removes some Prejit+instrumentation related flags - we don't support that any way
  3. Consolidate all possible configurations for block counting in a single config switch - JitBlockProfilingKind

Expecting some nice SPMI size & TP diffs in aspnet collection
cc @AndyAyersMS

Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member

I like the idea, but can you look at what is going on in the asp.net block profile collection? I would not have expected those diffs. And unfortunately, it is the bulk of TP and CS wins.

Also I have been keeping the prejit stuff viable -- see eg #49267 (comment) -- @clamp03 is that still the case that you want to do instrumentation when prejitting?

@EgorBo EgorBo force-pushed the improve-block-profiling-cfg branch from 2b3ce39 to 1a21536 Compare February 7, 2023 09:53
@EgorBo
Copy link
Member Author

EgorBo commented Feb 7, 2023

@AndyAyersMS I've reverted the changes around the new env var + prejit. (env var broke aspnet_blocks and caused unexpected diffs)

The diffs now look sane, I've analyzed 20 random diffs and they all look reasonable, a typical diff looks like this:

image

There are quite a few large methods but still single-blocked (e.g. a chain of virtual calls) -- output codegen contains branches but those come from cast/runtime lookup expansions, thus, non-instrumentable.

@EgorBo EgorBo merged commit edd23fc into dotnet:main Feb 7, 2023
@EgorBo EgorBo deleted the improve-block-profiling-cfg branch February 7, 2023 18:36
@ghost ghost locked as resolved and limited conversation to collaborators Mar 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

Redundant block counter in a single-block method
2 participants