-
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
JIT: produce consistent flow graph when producing or consuming profile data #85860
JIT: produce consistent flow graph when producing or consuming profile data #85860
Conversation
…e data Always try and merge "branch to next" blocks when building the intial flow graph if BBINSTR or BBOPT is set. Fixes dotnet#85856.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAlways try and merge "branch to next" blocks when building the initial flow graph if BBINSTR or BBOPT is set. Fixes #85856.
|
@EgorBo PTAL This is going to cause some diffs and perhaps some (short lived) perf regressions, until static PGO catches up with updated schemas for some methods. |
Diffs from CI are more extensive than what I saw locally, let me pull down the latest MCHs and recheck this. Hmm, I guess I just misremembered what I'd seen. |
OSR and PGO both rely on the fact that the early flowgraph the JIT builds is the same flowgraph as the one seen in a previous JIT complation of that method, since there is metadata (patchpoint offset, pgo schema) that refers to the flowgraph. Previous work here (dotnet#85860) didn't ensure this for enough cases. In particular if Tier0 does not do early block merging, but OSR does, it's possible for the OSR entry point to fall within a merged block range, which the JIT is not prepared to handle. This lead to the asserts seen in dotnet#86125. The fix is to enable early block merging unless we're truly in a minopts or debug codegen mode (previous to this Tier0 would not merge unless it also was instrumenting; now it will always merge). An alternative fix would be to find the block containing the OSR entry IL offset, scan its statements, and split the block at the right spot, but that seemed more involved. Fixes dotnet#86125.
OSR and PGO both rely on the fact that the early flowgraph the JIT builds is the same flowgraph as the one seen in a previous JIT complation of that method, since there is metadata (patchpoint offset, pgo schema) that refers to the flowgraph. Previous work here (#85860) didn't ensure this for enough cases. In particular if Tier0 does not do early block merging, but OSR does, it's possible for the OSR entry point to fall within a merged block range, which the JIT is not prepared to handle. This lead to the asserts seen in #86125. The fix is to enable early block merging unless we're truly in a minopts or debug codegen mode (previous to this Tier0 would not merge unless it also was instrumenting; now it will always merge). An alternative fix would be to find the block containing the OSR entry IL offset, scan its statements, and split the block at the right spot, but that seemed more involved. Fixes #86125.
Always try and merge "branch to next" blocks when building the initial flow graph if BBINSTR or BBOPT is set.
Fixes #85856.