Skip to content

JIT: Disallow using float callee saves in x64 functions with patchpoints#127158

Merged
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:osr-xarch-float-callee-saves
Apr 21, 2026
Merged

JIT: Disallow using float callee saves in x64 functions with patchpoints#127158
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:osr-xarch-float-callee-saves

Conversation

@jakobbotsch
Copy link
Copy Markdown
Member

We do not restore these in the OSR methods so using these registers currently relies on the unwinder. We will have transitioning that does not use the unwinder soon so just disable using these registers. Since patchpoints only appear in tier0 methods it is not a big deal to avoid using these registers.

We do not restore these in the OSR methods so using these registers
currently relies on the unwinder. We will have transitioning that does
not use the unwinder soon so just disable using these registers. Since
patchpoints only appear in tier0 methods it is not a big deal to avoid
using these registers.
Copilot AI review requested due to automatic review settings April 20, 2026 13:43
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the x64 JIT register allocator to avoid allocating floating-point callee-saved registers in methods that contain patchpoints, addressing OSR transition semantics where these registers are not restored by the OSR method.

Changes:

  • In LinearScan initialization for AMD64, mask out RBM_FLT_CALLEE_SAVED from the available float/double register sets when the method has patchpoints (including partial compilation patchpoints).

Comment thread src/coreclr/jit/lsra.cpp Outdated
Comment thread src/coreclr/jit/lsra.cpp Outdated
Copilot AI review requested due to automatic review settings April 20, 2026 14:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/coreclr/jit/lsra.cpp
Comment thread src/coreclr/jit/lsra.cpp
@jakobbotsch
Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr superpmi-diffs

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Copy Markdown
Member Author

FYI @AndyAyersMS @dotnet/jit-contrib

No diffs

Comment thread src/coreclr/jit/lsra.cpp
@jakobbotsch jakobbotsch merged commit 51f194e into dotnet:main Apr 21, 2026
145 of 148 checks passed
@jakobbotsch jakobbotsch deleted the osr-xarch-float-callee-saves branch April 21, 2026 07:55
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants