Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/coreclr/jit/fginline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,9 +1021,10 @@ void Compiler::fgMorphCallInline(GenTreeCall* call, InlineResult* inlineResult)
inliningFailed = true;

// Clear the Inline Candidate flag so we can ensure later we tried
// inlining all candidates.
// inlining all candidates. In debug, remember that this was an inline candidate.
//
call->gtFlags &= ~GTF_CALL_INLINE_CANDIDATE;
INDEBUG(call->SetWasInlineCandidate());
}
}
else
Expand Down Expand Up @@ -1233,7 +1234,7 @@ Compiler::fgWalkResult Compiler::fgFindNonInlineCandidate(GenTree** pTree, fgWal

void Compiler::fgNoteNonInlineCandidate(Statement* stmt, GenTreeCall* call)
{
if (call->IsInlineCandidate() || call->IsGuardedDevirtualizationCandidate())
if (call->IsInlineCandidate() || call->IsGuardedDevirtualizationCandidate() || call->WasInlineCandidate())
{
return;
}
Expand Down
13 changes: 12 additions & 1 deletion src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -4304,7 +4304,8 @@ enum GenTreeCallDebugFlags : unsigned int
GTF_CALL_MD_DEVIRTUALIZED = 0x00000002, // this call was devirtualized
GTF_CALL_MD_UNBOXED = 0x00000004, // this call was optimized to use the unboxed entry point
GTF_CALL_MD_GUARDED = 0x00000008, // this call was transformed by guarded devirtualization
GTF_CALL_MD_RUNTIME_LOOKUP_EXPANDED = 0x00000010, // this runtime lookup helper is expanded
GTF_CALL_MD_WAS_CANDIDATE = 0x00000010, // this call is a (failed) inline candidate
GTF_CALL_MD_RUNTIME_LOOKUP_EXPANDED = 0x00000020, // this runtime lookup helper is expanded
};

inline constexpr GenTreeCallDebugFlags operator ~(GenTreeCallDebugFlags a)
Expand Down Expand Up @@ -5556,6 +5557,11 @@ struct GenTreeCall final : public GenTree
{
return (gtCallDebugFlags & GTF_CALL_MD_UNBOXED) != 0;
}

bool WasInlineCandidate() const
{
return (gtCallDebugFlags & GTF_CALL_MD_WAS_CANDIDATE) != 0;
}
#endif

bool IsSuppressGCTransition() const
Expand All @@ -5573,6 +5579,11 @@ struct GenTreeCall final : public GenTree
{
gtCallDebugFlags |= GTF_CALL_MD_GUARDED;
}

void SetWasInlineCandidate()
{
gtCallDebugFlags |= GTF_CALL_MD_WAS_CANDIDATE;
}
#endif

void SetExpandedEarly()
Expand Down
Loading