Skip to content

JIT: Recursive calls elimination #57260

Description

@hez2010

Description

I'm implementing Peano's natural number with Algebra Data Type in C#: https://gist.github.com/hez2010/39af351442c1b71a46e194bca72abfde

However, due to JIT cannot eliminate recursive calls, I got stackoverflow exception during runtime if the number is large enough.

To reproduce, execute c * c * c with above code.

This doesn't happen to Haskell (using ghc 9), so I think JIT should also be able to transform those calls to jmps for deep recursive calls.

Configuration

.NET 6 Preview 7

category:cq
theme:basic-cq

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions