-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: Improve wrapper method inliner heuristic #113266
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
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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Diffs from MihuBot look promising to me. |
@MichalStrehovsky NativeAOT failures seem like an ilc preexisting bug? |
The scanner needs to precompute everything RyuJIT is going to look at. Looks like in this case RyuJIT decided to inline past a generic recursion cutoff. Maybe a fix would be to add a call to runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Compilation.cs Lines 101 to 104 in c8f32e5
But I'm afraid RyuJIT will ask |
} | ||
|
||
if ((codeAddr < codeEndp - sz) && (OPCODE)getU1LittleEndian(codeAddr + sz) == CEE_RET) | ||
if ((codeAddr < codeEndp - sz) && doesMethodLookLikeWrapper(codeAddr + sz, codeEndp)) |
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.
Given it's called only here, it only supports
call
ldloc
box
ret
?
is this some specific pattern we need to support?
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.
nope. it's just that doesMethodLookLikeWrapper
can return true
for a single ret
so that it can be reused here.
Closing for now as I don't have enough time to investigate the regression currently. |
Extracted from #113256, with additional improvements for boxed structs return.
newarr
,newobj
andinitobj
ldloc.*
} +box
} +ret
@EgorBo