Skip to content

Dump likely class in gtDispTree #116231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jun 2, 2025

Since cast helpers may expand with PGO in late phases, it makes sense to print their top likely classes in JITDUMP, example:

*  JTRUE     void  
\--*  EQ        int   
   +--*  CALL help ref    CORINFO_HELP_ISINSTANCEOFCLASS (66% likely 'Progam+DerivedClass2')
   |  +--*  CNS_INT(h) long   0x7ff96d187878 class Progam+DerivedClass1
   |  \--*  LCL_VAR   ref    V02 loc0         
   \--*  CNS_INT   ref    null

Also, unify MAX_CAST_GUESSES with MAX_GDV_TYPE_CHECKS

@Copilot Copilot AI review requested due to automatic review settings June 2, 2025 22:07
@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 Jun 2, 2025
@EgorBo
Copy link
Member Author

EgorBo commented Jun 2, 2025

PTAL @AndyAyersMS @dotnet/jit-contrib

Copy link
Contributor

@Copilot 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 enhances debugging capabilities by printing the top likely classes in JITDUMP and unifies constants used for type checks.

  • Adds an extra parameter (verboseLogging) to control verbose logging in the type check candidate selection.
  • Replaces uses of MAX_CAST_GUESSES with MAX_GDV_TYPE_CHECKS to standardize limits across casts.
  • Extends debug output in gtDispTree to optionally print profiling information for cast helpers.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/jit/importercalls.cpp Adds verboseLogging parameter and adjusts logging conditions.
src/coreclr/jit/helperexpansion.cpp Unifies MAX_CAST_GUESSES with MAX_GDV_TYPE_CHECKS in candidate selection.
src/coreclr/jit/gentree.cpp Adds conditional debugging print for likely class data.
src/coreclr/jit/compiler.h Updates function prototype to include a verboseLogging parameter with a default value.
Comments suppressed due to low confidence (1)

src/coreclr/jit/helperexpansion.cpp:2159

  • Verify that MAX_GDV_TYPE_CHECKS is defined consistently across all build configurations and update surrounding comments to fully reflect the unification with MAX_CAST_GUESSES.
const int maxTypeChecks = min(comp->getGDVMaxTypeChecks(), MAX_GDV_TYPE_CHECKS);

Copy link
Contributor

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

@EgorBo
Copy link
Member Author

EgorBo commented Jun 2, 2025

Closing per #116223 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

1 participant