You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: Methods with switches aren't inlineable #55336
movedx,66jmp ConsoleApp26.Program:Test1(ushort):int:this; Total bytes of code: 10
Currently it's failed to inline into Test2:
INLINER: during 'fgInline' result 'failed this callee' reason 'has switch'
I guess it's tricky for the importer, but at least we could import it as a single JTRUE block when we pass a constant at the callsite (and that arg feeds that switch).
This is also a case for a switch on a sizeof(T) in a generic method with an unmanaged constraint, those switches should be completely ignored by the inliner as the JIT always knows which path will be taken.
Activity
MichalPetryka commentedon Jul 8, 2021
This is also a case for a
switchon asizeof(T)in a generic method with anunmanagedconstraint, those switches should be completely ignored by the inliner as the JIT always knows which path will be taken.AndyAyersMS commentedon Jul 9, 2021
See #10634 and #10658 (comment) -- latter has a prototype of the changes needed to enable inlining of switches.
There is a cache of switch info kept in the jit (
m_switchDescMap) that might need updating/invalidating too, I haven't looked.