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

Early out in impMarkInlineCandidate for minopts #86949

Merged
merged 2 commits into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6204,6 +6204,18 @@ void Compiler::impMarkInlineCandidate(GenTree* callNode,
CORINFO_CALL_INFO* callInfo,
IL_OFFSET ilOffset)
{
if (!opts.OptEnabled(CLFLG_INLINING))
{
/* XXX Mon 8/18/2008
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the date in the comment here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, but I only moved an existing code a bit up, didn't change it

* This assert is misleading. The caller does not ensure that we have CLFLG_INLINING set before
* calling impMarkInlineCandidate. However, if this assert trips it means that we're an inlinee and
* CLFLG_MINOPT is set. That doesn't make a lot of sense. If you hit this assert, work back and
* figure out why we did not set MAXOPT for this compile.
*/
assert(!compIsForInlining());
return;
}

GenTreeCall* call = callNode->AsCall();

// Call might not have an inline candidate info yet (will be set by impMarkInlineCandidateHelper)
Expand Down Expand Up @@ -6293,17 +6305,7 @@ void Compiler::impMarkInlineCandidateHelper(GenTreeCall* call,
// Let the strategy know there's another call
impInlineRoot()->m_inlineStrategy->NoteCall();

if (!opts.OptEnabled(CLFLG_INLINING))
{
/* XXX Mon 8/18/2008
* This assert is misleading. The caller does not ensure that we have CLFLG_INLINING set before
* calling impMarkInlineCandidate. However, if this assert trips it means that we're an inlinee and
* CLFLG_MINOPT is set. That doesn't make a lot of sense. If you hit this assert, work back and
* figure out why we did not set MAXOPT for this compile.
*/
assert(!compIsForInlining());
return;
}
assert(opts.OptEnabled(CLFLG_INLINING));

// Don't inline if not optimizing root method
if (opts.compDbgCode)
Expand Down