Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow to inline MethodGroup/Lamda directly passed as an argument #10049

Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
@dmitriyse

Description

@dmitriyse

This is an example where inlining logically possible, but currently not supported by JIT:

usingSystem;usingSystem.Runtime.CompilerServices;publicclassC{publicvoidInlineTest(){// This method should not call anything// Everything can be inlinedDoWithGuardTwice(PrintHello);//DoWithGuardTwice(()=>{Console.WriteLine("bye");});}publicvoidPrintHello(){Console.WriteLine("Hello");}[MethodImpl(MethodImplOptions.AggressiveInlining)]publicvoidDoWithGuardTwice(/*Probably with some hint here*/Actiona){lock(this){a();a();}}}

https://sharplab.io/#v2:C4LghgzgtgPgAgBgARwIwG4CwAoRLUB0ASgK4B2wAllAKYEDCA9lAA6UA2NATgMrcBulAMY0IWbDjgBmFACYk9JAG8cOJOpQy4AFiQBJMu0pkaAFVHAAFAEplagJD2A9E6SmAFpQhJawd4wATJAh/EnYgskZgJCEwdnYkMDIATz9jAHM1DWyXJABRfm5UzzJ0mKSkACMaJGMjEwCs7PUAEUYAdUo/AHESMC4A0wB3YRpLAAUuY2AACRp4xmtxZo0m5pc2zp6+geHRyxsAXgA+JTQATksAIkrkmiulgF8ltce1tekUXUnpuYWbNYqbArdQXa5/diMB7LDRvYGreHqADaAFkaH5AnpWOxLGiMQEsSx2AB5FhURhkCAEACC6XSXFEEEohQM9Qy1gAuh8tLpNl13L1+oMRiJLE4AFSTRiVMCVdjJJAjPzBZg1ErRdzcGji1xoeRgayAtbZSFCADWljSEENiOaQJBzTANhhDvUTpetuycK92RwcKAA===

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp