JIT: modify box/unbox/isinst/castclass expansions for fast jitting (dotnet/coreclr#13188)
When the jit is generating code in debug/minopts/rare-block modes,
we'd prefer it to generate code more quickly and worry less about overall
generated code performance.
Generally speaking smaller intermediate and final code should correlate
well with faster jitting.
This change alters the expansions of box, unbox, isinst, and castclass when
generating code for minopts, debug, or in rarely run blocks. In such modes
the jit estimates whether an inline sequence or general helper call would
result in more compact code, and then chooses the smaller sequence.
This reduces generated code size around 2.5% in a variety of scenarios,
and roughly translates to a 1.5% improvement in time spent jitting.
Similar strategies can be applied to other complex operations during
importation. That work is forthcoming.
Commit migrated from https://github.com/dotnet/coreclr/commit/
47b38daad7d9e0cc754e9a663b211d262ee499d7