Skip to content

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Jul 7, 2025

Apply @jakobbotsch's suggestion

@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 Jul 7, 2025
@dotnet-policy-service
Copy link
Contributor

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

@EgorBo EgorBo force-pushed the ignore-ldarga-for-callvirt branch from b16b098 to a0e2b34 Compare July 7, 2025 14:05
@EgorBo
Copy link
Member Author

EgorBo commented Jul 8, 2025

PTAL @jakobbotsch @dotnet/jit-contrib I converted it to a clean up as we discussed, zero diffs.

@EgorBo EgorBo changed the title Don't set argHasLdargaOp flag on ldarga+constrained.callvirt Remove impResolveToken from implILConsumesAddr Jul 8, 2025
@EgorBo EgorBo marked this pull request as ready for review July 8, 2025 12:39
@EgorBo EgorBo requested review from Copilot and jakobbotsch July 8, 2025 12:39
Copy link
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 how the importer checks if an IL instruction consumes an address, removing the old token resolution in favor of a simpler opcode-based check, and adjusts related call sites and helper node creation.

  • Changed impILConsumesAddr signature to accept a var_types and codeEndp, and simplified its implementation to handle only CEE_LDFLD.
  • Updated call in fgFindJumpTargets to pass the new parameters and remove the redundant struct check.
  • Replaced manual clobber-and-rewrite of op1 in impImportBlockCode with a single gtNewLclAddrNode call.
  • Updated the function declaration in compiler.h.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/jit/importer.cpp Updated impILConsumesAddr signature and body; replaced inline address node rewrite with gtNewLclAddrNode.
src/coreclr/jit/fgbasic.cpp Adjusted call to impILConsumesAddr to use new parameters and removed the now-unneeded notStruct local.
src/coreclr/jit/compiler.h Modified impILConsumesAddr declaration to match the new signature.
Comments suppressed due to low confidence (1)

src/coreclr/jit/importer.cpp:53

  • [nitpick] Consider renaming the parameter typ to a more descriptive name like operandType or valueType to clarify what type it's representing.
bool Compiler::impILConsumesAddr(var_types typ, const BYTE* codeAddr, const BYTE* codeEndp)

Co-authored-by: Jakob Botsch Nielsen <[email protected]>
@EgorBo EgorBo merged commit d221687 into dotnet:main Jul 8, 2025
106 of 110 checks passed
@EgorBo EgorBo deleted the ignore-ldarga-for-callvirt branch July 8, 2025 18:38
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 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.

2 participants