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: Flowgraph Modernization and Improved Block Layout in .NET 10 #107749

Open
4 of 28 tasks
amanasifkhalid opened this issue Sep 12, 2024 · 1 comment
Open
4 of 28 tasks
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@amanasifkhalid
Copy link
Member

amanasifkhalid commented Sep 12, 2024

Continuation of #93020. During the .NET 9 development cycle, we removed much of the JIT flowgraph implementation's implicit fall-through invariants, and introduced a new block layout strategy based on a reverse post-order traversal of the graph. For .NET 10, we'd like to push this work further in both directions, with the ultimate goals of zero dependence on lexical block ordering in the JIT's frontend, and a global cost-optimizing layout algorithm in the JIT's backend. Below is an early estimate of what each item entails:

Flowgraph Modernization

Block layout
Ideally, the below items get us to a state where block layout produces the "best" ordering it can, given the profile data it has on-hand. If the layout is subpar due to missing/inconsistent profile data, we can at least eliminate the layout strategy as the culprit.

  • Implement 3-opt pass on top of the RPO-based layout, modeling layout cost with edge weights
  • Consider modeling cost of (un)conditional and forward/backward branches in layout cost for 3-opt
  • Consider how 3-opt's layout decisions may affect hot/cold splitting
  • Consider how we can achieve acceptable throughput, while running for enough iterations to achieve near-optimal layout
  • Continued deferred .NET 9 items

Profile Maintenance

  • Continue expanding profile consistency checks through the JIT's frontend. Currently, we bail after inlining.
  • Consider replacing optSetBlockWeights with the new profile synthesis implementation. The former frequently produces nonsensical weights for loops, as it relies on a lexical traversal of the block list to identify loops. Fixing this may improve JitOptRepeat performance.
  • Consider running profile synthesis right before layout.
  • Allow profile data to override the JIT's heuristics more explicitly. For example, if profile data suggests a BBJ_THROW block is hot, then order it as such (this particular example is not as perf-sensitive, though).

cc @dotnet/jit-contrib, @AndyAyersMS

@amanasifkhalid amanasifkhalid added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 12, 2024
@amanasifkhalid amanasifkhalid added this to the 10.0.0 milestone Sep 12, 2024
@amanasifkhalid amanasifkhalid self-assigned this Sep 12, 2024
Copy link
Contributor

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

@JulieLeeMSFT JulieLeeMSFT added the User Story A single user-facing feature. Can be grouped under an epic. label Sep 12, 2024
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 User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

2 participants