Repository navigation
Remove dead switch-table disassembly code from the xarch emitter - #130797
Merged
tannergooding merged 1 commit intoJul 15, 2026
Merged
tannergooding merged 1 commit into
tannergooding merged 1 commit into
Conversation
The INS_i_jmp label block in emitDispAddrMode keyed off an odd dsSize marker that no data section ever sets (all sizes are even and jump-table sections are now discriminated by dsType), so jdsc was always null and both display blocks were unreachable. Their sole producer, emitIns_IJ, had no callers, and the switch-table label/entries are already emitted by genEmitJumpTable. Remove the dead display code, the now-vestigial noDetail parameter, and emitIns_IJ. Co-authored-by: Copilot App <[email protected]>
|
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. |
Member
Author
|
CC. @dotnet/jit-contrib, @EgorBo This is simply removal of long dead code from the xarch emitter. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unreachable, legacy switch/jump-table disassembly logic from the xarch JIT emitter, simplifying debug output code paths without impacting codegen or runtime behavior.
Changes:
- Removes the dead
emitIns_IJhelper (no remaining references in the repo). - Simplifies
emitter::emitDispAddrModeby deleting the unreachable jump-table label/dump logic and removing the now-vestigialnoDetailparameter. - Updates xarch instruction display call sites to use the simplified
emitDispAddrModesignature.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/emitxarch.h | Drops emitDispAddrMode’s noDetail parameter and removes the emitIns_IJ declaration. |
| src/coreclr/jit/emitxarch.cpp | Removes the dead emitIns_IJ definition and deletes the unreachable jump-table disassembly blocks in emitDispAddrMode; updates all local callers accordingly. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
EgorBo
approved these changes
Jul 15, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 dead switch-table disassembly code from the xarch emitter.
The
INS_i_jmpblock inemitter::emitDispAddrModeidentified a jump-table data section by testingjdsc->dsSize & 1(an odd-size marker), then printed aJ_M%03u_DS%02ulabel and adjusted the displacement, and a trailing block dumped the table'sBasicBlock*targets.No data section ever has an odd
dsSizetoday:emitDataGenBegasserts(size % dataSection::MIN_DATA_ALIGN) == 0andemitBBTableDataGenBegstores evennumEntries * elemSize. Jump-table sections are now discriminated bydsType(blockRelative32/blockAbsoluteAddr), so the odd-size marker is a pre-dsTypefossil —jdscis alwaysnulland both display blocks are unreachable. Their sole producer,emitIns_IJ(the only function that emitted an address-modeINS_i_jmpwith a jump-tableidMemCookie), has no callers; modern switch codegen (genTableBasedSwitch) emitsjmp reg.git log -Son both the marker andemitIns_IJsurfaces only the 2020 directory-move (#44973), so this has been dead for a long time.This removes:
jtno/jdsclocals, theINS_i_jmplabel-finder loop +if (jdsc)printf, and theif (jdsc && !noDetail)table dump inemitDispAddrModenoDetailparameter (its only non-default caller passedisNewpurely to gate the dead dump)emitIns_IJThis is
DEBUG-only display code with no behavior change on any live path -- the only reachable address-modeINS_i_jmpisgenNonLocalJmp'sjmp [mem], which never carried a jump-table cookie, sojdscstayednullthere anddispwas never adjusted.The disassembly is unaffected because the same information is already produced by the live paths:
lea reg, [@RWD00]fromgenJumpTableviaemitIns_R_C) is labeled byemitDispClsVaras@RWD%02uemitter::emitDispDataSec, called fromemitOutputDataSecunderopts.disAsm, keyed offdsType == blockRelative32 / blockAbsoluteAddr, asdd/dq <blockLabel> ; case <blockLabel>genEmitJumpTableemits the verboseJ_M%03u_DS%02u LABEL DWORDheader + entries during codegenOther architectures are unaffected: the odd-
dsSizemarker was xarch-only,armalready identifies the table correctly viadsType == blockAbsoluteAddr(reachable through itsmovw/movt), andarm64/riscv64/loongarch64have no arch-specific jump-table display walk at all (they rely on the sharedemitDispDataSec+@RWDlabels).Built
clr.jit -c checked -a x64(0 warnings / 0 errors) and ranjitformat.py(no changes).Note
This PR description was drafted by GitHub Copilot on behalf of the author.