Skip to content

Commit

Permalink
Early out in impMarkInlineCandidate for minopts (#86949)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored May 31, 2023
1 parent d1bf019 commit e09e486
Showing 1 changed file with 13 additions and 11 deletions.
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
* 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

0 comments on commit e09e486

Please sign in to comment.