Skip to content

Remove dead code: compVSQuirkStackPaddingNeeded field - #121684

Merged
jakobbotsch merged 2 commits into
mainfrom
copilot/remove-compvsquirkstackpaddingneeded-field
Nov 17, 2025
Merged

jakobbotsch merged 2 commits into
mainfrom
copilot/remove-compvsquirkstackpaddingneeded-field

Conversation

Copilot AI commented Nov 16, 2025 •

Copy link
Copy Markdown
Contributor

The compVSQuirkStackPaddingNeeded field was always initialized to 0 and never assigned any other value, making its conditional check perpetually false and the associated code unreachable.

Changes

  • compiler.h: Removed field declaration and VSQUIRK_STACK_PAD macro
  • codegencommon.cpp: Removed initialization assignment
  • lclvars.cpp: Removed dead conditional block that would never execute
// Before: Dead code that never executed
if (compVSQuirkStackPaddingNeeded > 0)  // Always false
{
    stkOffs -= compVSQuirkStackPaddingNeeded;
    lvaIncrementFrameSize(compVSQuirkStackPaddingNeeded);
}

// After: Removed entirely

The field was originally intended as a quirk for VS debug-launch scenarios but was never actually used.

Original prompt

Remove the compVSQuirkStackPaddingNeeded field in JIT source code under src/coreclr/jit folder


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 16, 2025
Copilot AI changed the title [WIP] Remove compVSQuirkStackPaddingNeeded field in JIT source code Remove dead code: compVSQuirkStackPaddingNeeded field Nov 16, 2025
Copilot AI requested a review from jakobbotsch November 16, 2025 16:22
@jkotas jkotas added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 16, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch
jakobbotsch marked this pull request as ready for review November 17, 2025 12:09
Copilot AI review requested due to automatic review settings November 17, 2025 12:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes dead code related to the compVSQuirkStackPaddingNeeded field that was originally intended as a quirk for VS debug-launch scenarios but was never actually utilized. The field was always initialized to 0 and never assigned any other value, making the associated conditional code unreachable.

Key changes:

  • Removed the unused compVSQuirkStackPaddingNeeded field and VSQUIRK_STACK_PAD macro
  • Eliminated dead conditional block that could never execute
  • Cleaned up initialization code that served no purpose

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/jit/compiler.h Removed field declaration and VSQUIRK_STACK_PAD macro from the Compiler class
src/coreclr/jit/codegencommon.cpp Removed initialization of the field in the CodeGen constructor
src/coreclr/jit/lclvars.cpp Removed the unreachable conditional block that adjusted stack offsets for the quirk

@jakobbotsch
jakobbotsch merged commit 1926d82 into main Nov 17, 2025
@jakobbotsch
jakobbotsch deleted the copilot/remove-compvsquirkstackpaddingneeded-field branch November 17, 2025 12:41
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 18, 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.

4 participants