Uh oh!
There was an error while loading. Please reload this page.
JIT: Remove _MAYBENULL Helper uses - #132539
Conversation
_MAYBENULL Helper uses in the JIT_MAYBENULL Helper uses|
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. |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
This PR updates the CoreCLR JIT to stop requesting the *_MAYBENULL helper variants for TypeHandle → RuntimeType{Handle} conversions, instead using explicit null checks where needed and the non-_MAYBENULL helpers otherwise.
Changes:
CEE_REFANYTYPEimport now emits an inlinehandle != 0conditional that either returnsdefault(RuntimeTypeHandle)or callsCORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE.Type.GetTypeFromHandleintrinsic folding no longer rewrites toCORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL; it assumes the non-null helper flow and rewrites toCORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/jit/importercalls.cpp | Simplifies Type.GetTypeFromHandle intrinsic rewriting to always use the non-_MAYBENULLCORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE helper when the argument is a TypeHandle→RuntimeTypeHandle helper call. |
| src/coreclr/jit/importer.cpp | Replaces CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL usage in CEE_REFANYTYPE with an explicit null check and conditional default initialization. |
_MAYBENULL Helper uses_MAYBENULL Helper uses|
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. |
EgorBo
commented
Aug 21, 2026
Should this PR physically remove _MAYBENULL everywhere? |
adamperlin
commented
Aug 21, 2026
It's still used in the interpreter, so I thought maybe removing it in the interpreter could be a separate change? I'm happy to add that to this PR though! |
jkotas
commented
Aug 21, 2026
I think it would be nice to do it all on one PR |
Resolves#132343 and resolves#132185; Remove requests for
_MAYBENULLhelper variants in the JIT for TypeHandle -> RuntimeType{Handle} conversions.