Remove unused functions from the xarch emitter#130803
Merged
tannergooding merged 2 commits intoJul 18, 2026
Merged
Conversation
These functions all had zero call sites anywhere in the repo: - emitExtractRex2Prefix, AddRex2WPrefix, insKMaskBaseSize (declared, never defined) - AddVexPrefixIfNeeded, AddVexPrefixIfNeededAndNotPresent, AddSimdPrefixIfNeededAndNotPresent (unused inline prefix helpers) - emitIns_AI_R, emitIns_I_AI, emitIns_I_AX, emitIns_R_AX, emitIns_AX_R, emitIns_I_ARR, emitIns_I_ARX, emitIns_R_R_AR_I (unused instruction emitters) - IsAVXOnlyInstruction, emitIns_J_S Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a set of unused CoreCLR xarch emitter helpers/emitters from src/coreclr/jit/emitxarch.h and emitxarch.cpp, reducing dead code in the JIT emitter without intended behavioral changes.
Changes:
- Removed unused declarations and inline helpers from
emitxarch.h(prefix/encoding helpers and severalemitIns_*APIs). - Removed corresponding unused method implementations from
emitxarch.cpp(includingIsAVXOnlyInstructionand severalemitIns_*helpers). - Verified by repository-wide search that the removed symbols have no remaining references.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/emitxarch.h | Deletes unused emitter APIs and inline prefix helpers from the xarch emitter header. |
| src/coreclr/jit/emitxarch.cpp | Deletes unused xarch emitter method implementations corresponding to the removed declarations. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
Member
Author
|
@dotnet/jit-contrib, @EgorBo More trivially dead code |
EgorBo
reviewed
Jul 15, 2026
EgorBo
approved these changes
Jul 15, 2026
tannergooding
enabled auto-merge (squash)
July 15, 2026 21:00
Member
Author
|
@EgorBo, needs re-approval due to resolving a merge conflict |
EgorBo
approved these changes
Jul 16, 2026
Open
3 tasks
Member
Author
|
/ba-g unrelated timeouts |
tannergooding
deleted the
tannergooding-jit-remove-dead-xarch-emitter-fns
branch
July 18, 2026 16:43
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.
Removes 16 functions from the CoreCLR xarch emitter that had zero call sites anywhere in the repo. This is a DEBUG/encoding cleanup only -- no behavioral change.
Each function's declaration in
emitxarch.hand definition (with its doc-comment block) inemitxarch.cppwas removed, after re-verifying zero callers viagit grep -w <name> -- 'src/coreclr/*'.Removed:
emitExtractRex2Prefix,AddRex2WPrefix,insKMaskBaseSize(all declared but never defined);AddVexPrefixIfNeeded,AddVexPrefixIfNeededAndNotPresent,AddSimdPrefixIfNeededAndNotPresent(unused inline defs)emitIns_AI_R,emitIns_I_AI,emitIns_I_AX,emitIns_R_AX,emitIns_AX_R,emitIns_I_ARR,emitIns_I_ARX,emitIns_R_R_AR_IIsAVXOnlyInstruction,emitIns_J_SChecked for cascaded dead code after removal via a zero-caller scan over all emitxarch.h-declared method names -- no functions became newly dead as a result of these deletions; every helper the removed bodies called remains used elsewhere.
emitIns_IJwas found to be a pre-existing zero-caller function unrelated to this change, so it is intentionally left out of scope here.Build (
build.cmd clr.jit -c checked -a x64) succeeds with 0 warnings / 0 errors, and jit-format produces no changes.Note
This PR description and the changes were drafted with the assistance of GitHub Copilot.