JIT: Run 3-opt once across all regions by amanasifkhalid · Pull Request #111989 · dotnet/runtime · GitHub
Skip to content

JIT: Run 3-opt once across all regions#111989

Merged
amanasifkhalid merged 1 commit into
dotnet:mainfrom
amanasifkhalid:run-3-opt-once
Jan 30, 2025
Merged

JIT: Run 3-opt once across all regions#111989
amanasifkhalid merged 1 commit into
dotnet:mainfrom
amanasifkhalid:run-3-opt-once

Conversation

@amanasifkhalid

@amanasifkhalid amanasifkhalid commented Jan 30, 2025

Copy link
Copy Markdown
Contributor

Part of #107749. 3-opt layout already refuses to align branches that cross EH regions, so there doesn't seem to be much utility in reordering each EH region independently. Thus, remove 3-opt's per-region ordering constraints, and run 3-opt once.

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 30, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

@amanasifkhalid

Copy link
Copy Markdown
Contributor Author

/azp run runtime-coreclr libraries-jitstress, runtime-coreclr libraries-pgo

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@amanasifkhalid amanasifkhalid marked this pull request as ready for review January 30, 2025 16:32
@amanasifkhalid

Copy link
Copy Markdown
Contributor Author

@AndyAyersMS AndyAyersMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the plan you're proposing makes sense, we should have just one primary algorithm for relocating blocks.

@amanasifkhalid amanasifkhalid merged commit 84f4c2a into dotnet:main Jan 30, 2025
@amanasifkhalid amanasifkhalid deleted the run-3-opt-once branch January 30, 2025 18:15
grendello added a commit to grendello/runtime that referenced this pull request Jan 30, 2025
* main: (31 commits)
  More native AOT Pri-1 test tree bring up (dotnet#111994)
  Fix BigInteger outerloop test (dotnet#111841)
  JIT: Run 3-opt once across all regions (dotnet#111989)
  JIT: Check for profile consistency throughout JIT backend (dotnet#111684)
  [JIT] Add legacy extended EVEX encoding and EVEX.ND/NF feature to x64 emitter backend (dotnet#108796)
  [iOS][globalization] Fix IndexOf on empty strings on iOS to return -1 (dotnet#111898)
  System.Speech: Use intellisense xml from dotnet-api-docs (dotnet#111983)
  [mono][mini] Disable inlining if we encounter class initialization failure (dotnet#111754)
  [main] Update dependencies from dotnet/roslyn (dotnet#111946)
  Update dependencies from https://github.com/dotnet/arcade build 20250129.2 (dotnet#111996)
  Try changing the ICustomQueryInterface implementation to always return NotHandled instead of Failed to defer back to the ComWrappers impl. (dotnet#111978)
  Combined dependency update (dotnet#111852)
  Replace OPTIMIZE_FOR_SIZE with feature switch (dotnet#111743)
  Fix failed assertion 'FPbased == FPbased2' (dotnet#111787)
  Add remark to `ConditionalSelect` (dotnet#111945)
  JIT: fix try region cloning when try is nested in a handler (dotnet#111975)
  Use IRootFunctions in Tensor.StdDev (dotnet#110641)
  Remove zlib dependencies from Docker containers (dotnet#111939)
  Avoid `Unsafe.As` for `Memory<T>` and `ReadOnlyMemory<T>` conversion (dotnet#111023)
  Cleanup membarrier portability (dotnet#111943)
  ...
amanasifkhalid added a commit that referenced this pull request Feb 6, 2025
Follow-up to #111989. Now that we only run one pass of 3-opt, we can remove some cruft needed to maintain state across 3-opt passes. This is a meek attempt to reduce the size of #112004 by separating out some of the no-diff changes.
amanasifkhalid added a commit that referenced this pull request Feb 20, 2025
Part of #107749. Based on the plans outlined in #111989 (comment), we want to remove phases that prematurely tweak the initial layout fed into 3-opt; fgMoveHotJumps is one such phase. However, initial attempts to remove it incurred large size increases on x86/x64, suggesting there was some utility in moving blocks closer to their hottest successors to keep the layout compact. To avoid derailing my consolidation plan, I've decided to refactor fgMoveHotJumps into a utility for 3-opt to use. For now, we will continue to use this pass to try to keep the layout compact. In the future, this functionality may be useful for churning the initial layout into 3-opt to discover new local-optimal layouts.
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2025
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