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

JIT: move and revise fgExpandRunRarelyBlocks #50765

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

AndyAyersMS
Copy link
Member

Move to fgopt, and rework to make its operation a bit more obvious.

Move to fgopt, and rework to make its operation a bit more obvious.
@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 Apr 6, 2021
@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

@AndyAyersMS
Copy link
Member Author

No SPMI diffs.

@EgorBo
Copy link
Member

EgorBo commented Apr 6, 2021

No SPMI diffs.

Can we teach SPMI to detect "invalid weights" differences?
E.g.
was: 100 methods with "invalid weights" flag
now: 120 methods with "invalid weights" flag

something like that

@AndyAyersMS
Copy link
Member Author

Can we teach SPMI to detect "invalid weights" differences?

Not easily, at least with the current mode of operation. SPMI diffs key off of things observable via the jit interface.

We have discussed adding a callback to the runtime that would only happen under SPMI, to allow the jit to report "facts" about each method. The runtime would ignore this callback but SPMI would not.

Having something like that would allow SPMI to compare the facts for each method between two jits, and then it could count / summarize and describe the nature of those diffs.

@EgorBo
Copy link
Member

EgorBo commented Apr 6, 2021

Thanks, another question:
So imagine I somehow got a layout like this:

BB0 [IBC: 100]
  ↓
BB1 [BBF_RUN_RARELY]

The current algorithm will just make BB0 cold, am I right? I just wonder if it could notify that it's going to ignore IBC data for a block and make it cold and most likely something went wrong - or we'll just rely on fgComputeEdgeWeights for that?

@AndyAyersMS
Copy link
Member Author

The current algorithm will just make BB0 cold, am I right?

If profile data is consistent then it shouldn't -- but if it is inconsistent, it might. So these should be flagged by the consistency checker. It might make sense to add a jitdump note if we ever change a profiled non-zero weight to zero.

@AndyAyersMS AndyAyersMS merged commit 84f97f8 into dotnet:main Apr 6, 2021
@AndyAyersMS AndyAyersMS deleted the fgReorderBlocks branch April 6, 2021 18:51
@JulieLeeMSFT JulieLeeMSFT added this to the 6.0.0 milestone Apr 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 15, 2021
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.

3 participants