-
Notifications
You must be signed in to change notification settings - Fork 4.9k
GDV: Multiple type-checks work items #86769
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
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsA tracking issue for progress related to GDV with multiple type-checks. Essentially, today we expand virtual calls like this: obj.DoWork(); is profiled and is expanded like this in Tier1: if (obj is Class1)
((Class1)obj).DoWork(); // no longer virtual, can be inlined
else
obj.DoWork(); // fallback However, for virtual call-sites where we see more than a single dominating class we want to be able to expand multiple candidates, e.g.: if (obj is Class1)
((Class1)obj).DoWork();
if (obj is Class2)
((Class2)obj).DoWork();
if (obj is Class3 || obj is Class4) // e.g. they share the same method
((Class3)obj).DoWork();
else
obj.DoWork(); // fallback (can be omitted in case of NativeAOT) Tasks:
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsA tracking issue for progress related to GDV with multiple type-checks. Essentially, today we expand virtual calls like this: obj.DoWork(); // interface or virtual call and JIT doesn't know obj's exact type Jit is able to record (probe) if (obj is Class1)
((Class1)obj).DoWork(); // no longer virtual, can be inlined
else
obj.DoWork(); // virtual call as a fallback We call this Guarded Devirtualization or GDV. if (obj is Class1)
((Class1)obj).DoWork();
if (obj is Class2)
((Class2)obj).DoWork();
if (obj is Class3 || obj is Class4) // e.g. they share the same method since DoWork is not overriden in Class4
((Class3)obj).DoWork();
else
obj.DoWork(); // fallback (can be omitted in case of NativeAOT) Tasks:
|
A tracking issue for progress related to GDV with multiple type-checks. Essentially, today we expand virtual calls like this:
Jit is able to record (probe)
obj
's type in Tier0 so then in Tier1 we can expand it like this;We call this Guarded Devirtualization or GDV.
However, for polymorphic virtual call-sites where we see more than a single dominating class we want to be able to expand multiple candidates, e.g.:
Tasks:
getLikelyClass
to return multiple candidates: JIT: Return multiple likely classes in getLikelyClass (for better GDV) #58984if (obj is Class3 || obj is Class4)
The text was updated successfully, but these errors were encountered: