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

Simplify condition to detect recursive inlining #88849

Merged
merged 1 commit into from
Jul 14, 2023
Merged

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jul 13, 2023

This change simplifies the conditon and also makes it more robust. There are situation where the IL code pointer can differ for the same method.

This change simplifies the conditon and also makes it more robust. There
are situation where the IL code pointer can differ for the same method.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 13, 2023
@ghost ghost assigned jkotas Jul 13, 2023
@jkotas
Copy link
Member Author

jkotas commented Jul 13, 2023

Related to #88749

@jkotas jkotas requested a review from AndyAyersMS July 13, 2023 16:43
@ghost
Copy link

ghost commented Jul 13, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

This change simplifies the conditon and also makes it more robust. There are situation where the IL code pointer can differ for the same method.

Author: jkotas
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any simple explanation as to why this address might vary or differ during a single jit invocation?

I vaguely remember something like this a while back from the crossgen2 host where the IL buffer wasn't kept pinned for long enough.

@jkotas
Copy link
Member Author

jkotas commented Jul 13, 2023

I vaguely remember something like this a while back from the crossgen2 host where the IL buffer wasn't kept pinned for long enough.

Right, that is one possible case. The AOT compilers cache the IL bodies (that can be computed or altered by trimming) and flush the cache every once in a while:

// Flush the cache when it grows too big
if (_methodILCache.Count > 1000)
_methodILCache = new ILCache(_methodILCache.ILProvider);

Another one is profiler IL rewriting. The profilers can change the method IL body at will.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants