Repository navigation
JIT: Preserve unused volatile loads - #137117
Merged
AndyAyersMS merged 1 commit intoNov 9, 2026
Merged
Conversation
Keep volatile loads and their acquire semantics when extracting side effects and removing dead code. Resolves dotnet#136888 Co-authored-by: Copilot <[email protected]> Copilot-Session: 9cc9c0d2-0703-4d8a-bd9a-84a28b236726
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
Author
|
ptal @dotnet/contrib |
jakobbotsch
reviewed
Nov 9, 2026
jakobbotsch
approved these changes
Nov 9, 2026
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Side effect extraction could drop a nonfaulting volatile read when folding a comparison. Repeated optimization could then hoist an ordinary load out of the polling loop and cause a hang.
Recognize volatile ordering effects and preserve acquire semantics through comma morphing, unused-load lowering, and LIR dead-code removal. Ordinary operations with ordering constraints remain removable.
Validation on Windows x64 Checked:
Default
python src\coreclr\scripts\superpmi.py asmdiffs: 968,442 contexts, zero missing, four diffs, +21 bytes. OnlyRuntime_134477:Testgrows; three other contexts replace null-check compares with same-size volatile loads. NativeAOT and libraries have no diffs.Resolves #136888
Note
This pull request was generated with GitHub Copilot.