-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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 SuperPMIoptimization
Milestone
Description
This is an example where inlining logically possible, but currently not supported by JIT:
using System;
using System.Runtime.CompilerServices;
public class C {
public void InlineTest() {
// This method should not call anything
// Everything can be inlined
DoWithGuardTwice(PrintHello);
//DoWithGuardTwice(()=>{Console.WriteLine("bye");});
}
public void PrintHello()
{
Console.WriteLine("Hello");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void DoWithGuardTwice(/*Probably with some hint here*/ Action a)
{
lock(this)
{
a();
a();
}
}
}This is a complex type of inlining. As an alternative this type of inlining was proposed to be implemented at the C# compiler level: dotnet/csharplang#1413
category:cq
theme:inlining
skill-level:expert
cost:medium
hez2010 and ZacharyPatten
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 SuperPMIoptimization