Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods with calli fail to inline because of unsupported opcode #8519

Closed
mjsabby opened this issue Jul 10, 2017 · 3 comments
Closed

Methods with calli fail to inline because of unsupported opcode #8519

mjsabby opened this issue Jul 10, 2017 · 3 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Milestone

Comments

@mjsabby
Copy link
Contributor

mjsabby commented Jul 10, 2017

Today an occurrence of the calli opcode in a method body prevents it from being even considered as an inline candidates quite early on in the Flowgraph processing, while finding basic blocks and then jump targets.

Specifically in Compiler::fgFindJumpTargets(https://github.com/dotnet/coreclr/blob/master/src/jit/flowgraph.cpp#L4767)

        case CEE_CALLI:
        case CEE_LOCALLOC:
        case CEE_MKREFANY:
        case CEE_RETHROW:
            // CEE_CALLI should not be inlined because the JIT cannot generate an inlined call frame. If the call
            // target
            // is a no-marshal CALLI P/Invoke we end up calling the IL stub. We don't NGEN these stubs, so we'll
            // have to
            // JIT an IL stub for a trivial func. It's almost certainly a better choice to leave out the inline
            // candidate so we can generate an inlined call frame. It might be nice to call getCallInfo to figure
            // out
            // what kind of call we have here.

This limitation (about inlined call frame for PInvokes) may still hold true for unmanaged calling conventions that require it, but for default calling convention targets there is no need to raise a frame (afaict).

We should be able to remove the restriction for call targets with the default cc without any major plumbing.

@mjsabby
Copy link
Contributor Author

mjsabby commented Jul 10, 2017

@AndyAyersMS

@AndyAyersMS
Copy link
Member

Believe this was fixed by dotnet/coreclr#13756. @mjsabby can you confirm and close?

@mjsabby
Copy link
Contributor Author

mjsabby commented Mar 25, 2018

Works, thanks!

@mjsabby mjsabby closed this as completed Mar 25, 2018
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

3 participants