Uh oh!
There was an error while loading. Please reload this page.
JIT: Propagate class handle when split tree - #128485
Conversation
hez2010
commented
May 22, 2026
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates gtSplitTree to better annotate compiler-generated temps created during tree splitting, including marking them as single-definition locals and propagating reference type class metadata when available.
Changes:
- Marks the temporary local produced by
gtNewTempStoreaslvSingleDef. - When the value is a
TYP_REF, attempts to propagate its class handle to the temp vialvaSetClass. - Refactors the splitting logic to use a named
valuetemp for clarity.
Comments suppressed due to low confidence (2)
src/coreclr/jit/gentree.cpp:1
isNonNullis computed viagtGetClassHandle(...)but not used. Either removeisNonNullentirely if it’s not needed here, or (preferred if available in this codebase) propagate the non-null information to the temp local (e.g., via the appropriate lva* API) so the extra work has a functional effect.
src/coreclr/jit/gentree.cpp:1- This directly mutates
lvSingleDefat the point of inserting a store. If later phases can introduce additional defs for this temp (or iflvSingleDefis expected to be derived by an analysis pass instead of being set manually), this risks stale/incorrect single-def metadata. Consider setting this only when the temp is created (where its lifetime/def-count is guaranteed), or using an existing helper/annotation mechanism for ‘compiler temp known single-def’ (so invariants stay centralized).
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
src/coreclr/jit/gentree.cpp:1
isNonNullis populated bygtGetClassHandlebut never used afterward. If nullability isn’t needed here, passnullptrfor that out-param and removeisNonNull; if it is needed, propagate it onto the local using the appropriate local/property so the information isn’t computed and then dropped.
src/coreclr/jit/gentree.cpp:1- Prefer assigning boolean fields using
true/falserather than1/0to better communicate intent and avoid relying on the underlying representation of the field.
Uh oh!
There was an error while loading. Please reload this page.
AndyAyersMS
commented
May 22, 2026
Thanks for finding and fixing this. |
Propagate the class handle when we spill a tree into a local so that later devirtualization can see the more exact class.
Codegen for the snippet in the linked issue:
Before:
After:
Resolves#128483