Skip to content

Conversation

@jakobbotsch
Copy link
Member

This specializes fgFindJumpTargets based on whether we are making inline observations or not. This function has a lot of conditional logic based on this property, but it is always going to be false in MinOpts, so this allows the native compiler to optimize the function much better (and avoids all the conditionals).

Using the VS profiler shows that the relative CPU time spent in the function goes from 0.98% to 0.47% for the MinOpts contexts in benchmarks.run_pgo.windows.x64.

This should pay off the TP cost of #103537.

This specializes `fgFindJumpTargets` based on whether we are making
inline observations or not. This function has a lot of conditional logic
based on this property, but it is always going to be false in MinOpts,
so this allows the native compiler to optimize the function much better
(and avoids all the conditionals).

Using the VS profiler shows that the relative CPU time spent in the
function goes from 0.98% to 0.47% for the MinOpts contexts in
benchmarks.run_pgo.windows.x64.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 20, 2024
@dotnet-policy-service
Copy link
Contributor

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

@EgorBo
Copy link
Member

EgorBo commented Jun 20, 2024

Heh, I remember I tried the same, but the savings were too small so I didn't bother, let's see what you will get 🙂

@jakobbotsch
Copy link
Member Author

jakobbotsch commented Jun 20, 2024

cc @dotnet/jit-contrib

Diffs. This gets most of the MinOpts regression from #103537 back, though it doesn't entirely make up for it in all cases.

@jakobbotsch
Copy link
Member Author

/ba-g Failures are timeouts on Linux-x64 due to slow Helix queues

@jakobbotsch jakobbotsch merged commit b0f3c19 into dotnet:main Jun 20, 2024
@jakobbotsch jakobbotsch deleted the specialize-fgFindJumpTargets branch June 20, 2024 17:58
rzikm pushed a commit to rzikm/dotnet-runtime that referenced this pull request Jun 24, 2024
This specializes `fgFindJumpTargets` based on whether we are making
inline observations or not. This function has a lot of conditional logic
based on this property, but it is always going to be false in MinOpts,
so this allows the native compiler to optimize the function much better
(and avoids all the conditionals).

Using the VS profiler shows that the relative CPU time spent in the
function goes from 0.98% to 0.47% for the MinOpts contexts in
benchmarks.run_pgo.windows.x64.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2024
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.

2 participants