Methods with struct parameters are not inlined #53783
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
Based on x64 in sharplab:
https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABABgAJiBGAOgCUBXAOwwEt8YaBhCfAB1YAbGFADKIgG6swMXAG4AsAChlxAEzku5AN7Ly5PfsopyAMSoAKAGaCI2DOSsBKcgF4AfGbXWnipUeMva1t7RxcPMwBmHz8A4hNTaJs7B2c3TwBZGIDDfVzyAG0MmAwACwgAEwBJfkELYrLKmr5BAHk+NggmXBoAOQgqpkFWJhGAcycAXXz48izk0LTtcgBfZRWgA=
The following:
is compiled as:
Methods with primitive parameters are inlined, and F1, F2, and F3 output the same code.
https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABABgAJiBGAOgCUBXAOwwEt8YaBhCfAB1YAbGFADKIgG6swMXAG4AsAChlxAEzku5AN7Ly+8noO4MUBmAzkAYoIjYM2ygGZyAM1v3yANWyCGMOXIAXyN9UMoUayoAChs7S1cASnIAXgA+azVopMUlAwjM2I8E5PTrJ2zE3PziSKsKuM8k1IyAWUrAg3DwgG1WmAwACwgAEwBJfkFo/qHRib5BAHk+NggmXBoAOQgxpkFWJgOAc0SAXXDa8nbGkp1g5SCgA
But this sample:
is compiled as:
F1 and F2 are longer than F3 and seem to consume unnecessary stack. These methods are expected to work the same, so why this difference?
category:cq
theme:inlining
skill-level:intermediate
cost:medium
impact:medium
The text was updated successfully, but these errors were encountered: