Resolve call mdtokens when making tier 1 inline observations #50675
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates
Compiler::fgFindJumpTargets
to support resolving call tokens when making inline observations for Tier 1.A test of
csc
compiling a simpleHelloWorld
program (csc.dll Program.cs /r:System.Runtime.dll /r:System.Console.dll /r:System.Private.Corelib.dll
) withCOMPlus_ReadyToRun=0
andCOMPlus_TieredCompilation=0
resulted in the following impact:Compiler::fgFindJumpTarget
goes from0.48%
to0.63%
of instructions retired (28.5m
to39.25m
)CEEInfo::resolveToken
goes from0.32%
to0.34%
of instructions retired (19m
to21m
)CEEInfo::getCallInfo
goes from0.36%
to0.32%
of instructions retired (21.25m
to19.75m
)As per the flame graph (see below), the majority of time is still spent in the backend. There was no measured impact for
tier 0
methods.This change will allow us to make potential improvements to inlining for methods that involve many intrinsic calls. Some potential metrics we could use to influence inlining include:
intrinsic
(Named or Otherwise)hwintrinsic
and therefore are not calls at all, but are effectively "simple ops"Math
calls)Isa.IsSupported
string.Length
orType.op_Equality
checksWe can place this behind a
DOTNET_*
(COMPlus_*
) switch if there are any remaining concerns around impact.