Skip to content

JIT: expand Object.GetType at Tier0 - #134708

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:tier0-gettype-intrinsic
Sep 26, 2026
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:tier0-gettype-intrinsic

Conversation

@EgorBo

@EgorBo EgorBo commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Expand Object.GetType as an intrinsic at Tier0 so obj.GetType() == typeof(X) folds early and dead branches aren't imported.

Allows folding obj.GetType() == typeof(X) at Tier0, avoiding dead branch imports.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: b4a40cce-7d88-4ea2-894d-de51f9684999
@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 Sep 26, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@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.

@EgorBo

EgorBo commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

ptal @dotnet/jit-contrib single-line change, some diffs

@EgorBo
EgorBo merged commit 9b5819d into dotnet:main Sep 26, 2026
138 of 141 checks passed
@EgorBo
EgorBo deleted the tier0-gettype-intrinsic branch September 26, 2026 16:54
@jkotas

jkotas commented Sep 26, 2026

Copy link
Copy Markdown
Member

Expand Object.GetType as an intrinsic at Tier0 so obj.GetType() == typeof(X) folds early and dead branches aren't imported

This does not seem to be an accurate characterization of the impact of this change.

The diffs that you have linked to show comparisons of RuntimeTypes transformed to comparison of MethodTable*, and also some elimination of null checks. Still a good diff, but I do not see any dead branch elimination.

@EgorBo

EgorBo commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

Expand Object.GetType as an intrinsic at Tier0 so obj.GetType() == typeof(X) folds early and dead branches aren't imported

This does not seem to be an accurate characterization of the impact of this change.

The diffs that you have linked to show comparisons of RuntimeTypes transformed to comparison of MethodTable*, and also some elimination of null checks. Still a good diff, but I do not see any dead branch elimination.

Hm.. good point, I assumed the diffs were just hidden behind the missing contexts in SPMI, but it seems it doesn't fold the branches yet. The good news is that it should be easily fixable (so we can fold branches early and don't even import their IL).

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 27, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 27, 2026
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.

3 participants