-
Couldn't load subscription status.
- Fork 5.2k
Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issuePerformance related issue
Milestone
Description
Description
JIT doesn't inline methods contain EH code.
Let's say this code:
void Test()
{
Console.WriteLine(Foo(3));
}
int Foo(int x)
{
try
{
return Get(x);
}
catch
{
return 0;
}
}
int Get(int x) => x is 1 ? throw new Exception() : x + 1;Expected codegen for Test:
mov ecx, 4
jmp System.Console.WriteLine(Int32)Actual codegen for Test:
sub rsp, 0x28
mov ecx, 3
call Program.Foo(Int32)
mov ecx, eax
add rsp, 0x28
jmp System.Console.WriteLine(Int32)Note that even I added [MethodImpl(MethodImplOptions.AggressiveInlining)] on top of the method Foo, it won't be inlined either.
Configuration
.NET 6
category:cq
theme:inlining
skill-level:expert
cost:medium
impact:medium
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issuePerformance related issue