-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: fix double reporting of some failures in the inline tree #118902
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
Conversation
We now eagerly create inlinee contexts when we try and inline, so in post-inline debug when we go to scan the trees for the calls that remain, we need to remember which ones were failed inline candidates and which ones we were never inline candidates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the JIT compiler where some inline failures were being double-reported in debug builds. The fix adds tracking to distinguish between calls that were considered for inlining but failed versus calls that were never inline candidates.
Key changes:
- Adds a new debug flag to track failed inline candidates
- Updates inline failure handling to mark calls that were attempted but failed
- Modifies post-inline debug scanning to avoid double-reporting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/jit/gentree.h | Adds GTF_CALL_MD_WAS_CANDIDATE flag and accessor methods for tracking failed inline candidates |
src/coreclr/jit/fginline.cpp | Sets the new flag on inline failures and updates debug scanning logic to check for it |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
For a simple test case #using System.Runtime.CompilerServices;
X.Test();
class X
{
static int sum()
{
int sum = 0;
for (int i = 0; i < 100; i++)
{
sum += i;
}
return sum;
}
[MethodImpl(MethodImplOptions.NoInlining)]
static int bar() => 3;
[MethodImpl(MethodImplOptions.NoInlining)]
public static int Test()
{
return sum() + bar() + sum();
}
} and with a checked build and
we used to print
and now print
@dotnet/jit-contrib PTAL Debug only change; no diffs. |
/ba-g host activation tests failed but no log to match on in one case |
We now eagerly create inlinee contexts when we try and inline, so in post-inline debug when we go to scan the trees for the calls that remain, we need to remember which ones were failed inline candidates and which ones we were never inline candidates.