[RyuJIT] Drop redundant static initalizations #48358
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
tenet-performance
Performance related issue
Milestone
To track #48279 (comment)
Example:
With #48279 we now should be able to inline that
Equals
(because we know the exact type ofcomparer
local) thus, thecomparer
variable becomes unused and we don't need to statically initialize theEqualityComparer<int>
, but we currently do:If we manage to get rid of it in such cases we'll be able to drop workarounds such as this one (and AFAIR a similar is being added to
PriorityQueue
now in #48346).Worth noting that in most cases static initialization is not emitted at all because a class can be already inited at the jit time. Unfortunately it happens rarely for methods with loops - such methods are compiled directly to tier1 and aren't re-jitted after.
A smaller repro:
Current codegen:
Expected codegen:
/cc @AndyAyersMS
The text was updated successfully, but these errors were encountered: