Open
Description
Given that we see nice perf improvements when JIT emits more tail calls (presumably, due to CET) it might makes sense to enable more patterns, e.g. mismatched return types with void
. Example:
int Test()
{
// some code to make it non-inlineable without NoInlining attribute
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
return 42;
}
void Bar()
{
Test();
}
Current codegen:
; Method Benchmarks:Bar():this (FullOpts)
G_M18344_IG01:
sub rsp, 40
G_M18344_IG02:
call [Benchmarks:Test():int:this]
nop
G_M18344_IG03:
add rsp, 40
ret
; Total bytes of code: 16
Expected: Test is tail-called.
cc @jakobbotsch @dotnet/jit-contrib