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

Use a more exact base class for considerGuardedDevirtualization #108497

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Changes from 2 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
8 changes: 7 additions & 1 deletion src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8175,7 +8175,13 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,
return;
}

considerGuardedDevirtualization(call, ilOffset, isInterface, baseMethod, baseClass, pContextHandle);
CORINFO_CLASS_HANDLE moreExactBaseClass = baseClass;
if (objClass != NO_CLASS_HANDLE)
Copy link
Member

Choose a reason for hiding this comment

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

Don't we already know objClass is not null here?

Copy link
Member Author

@EgorBo EgorBo Oct 4, 2024

Choose a reason for hiding this comment

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

Don't we already know objClass is not null here?

Yep, you're correct, removed the condition. Looks like it's not needed to do isMoreSpecific here (and it won't work for the Michal's case since one of the classes doesn't exist in fact).

{
moreExactBaseClass = objClass;
}

considerGuardedDevirtualization(call, ilOffset, isInterface, baseMethod, moreExactBaseClass, pContextHandle);
return;
}

Expand Down
Loading