Skip to content

Commit 6e678a5

Browse files
committed
Unblock late devirt as well
1 parent 5c15b23 commit 6e678a5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/coreclr/jit/fginline.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,12 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitor<Substi
613613
if (tree->OperIs(GT_CALL))
614614
{
615615
GenTreeCall* call = tree->AsCall();
616-
// TODO-CQ: Drop `call->gtCallType == CT_USER_FUNC` once we have GVM devirtualization
617-
bool tryLateDevirt = call->IsDevirtualizationCandidate(m_compiler) && (call->gtCallType == CT_USER_FUNC);
616+
bool tryLateDevirt = call->IsDevirtualizationCandidate(m_compiler);
617+
if (tryLateDevirt && call->gtCallType == CT_INDIRECT)
618+
{
619+
// For indirect calls, we can only late devirt if it's a generic virtual method for now.
620+
tryLateDevirt = call->IsGenericVirtual(m_compiler);
621+
}
618622

619623
#ifdef DEBUG
620624
tryLateDevirt = tryLateDevirt && (JitConfig.JitEnableLateDevirtualization() == 1);

0 commit comments

Comments
 (0)