-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Intrinsify typeof(T).IsGenericType #97148
Intrinsify typeof(T).IsGenericType #97148
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsContributes to #96898 Added tests but not entirely sure how to get diffs too 😅
|
527abd9
to
fa02580
Compare
fa02580
to
afde0ce
Compare
@MichalStrehovsky just making sure I'm following: so we don't need any NAOT-specific work for this nor for #97159? |
We shouldn't need it - unless you actually need this optimization to kick in during NAOT whole program analysis (the answer would typically be "I don't need that" if the T you need to optimize is a valuetype, or there's no pathologic genericness that is hard to get rid of once it makes into whole program view behind the if branch) |
a12a551
to
a5c7e1b
Compare
a5c7e1b
to
eb2b3a9
Compare
} | ||
else if ((info.compCompHnd->getClassAttribs(hClass) & CORINFO_FLG_SHAREDINST) != 0) | ||
{ | ||
// if we have no type arguments, check that the type itself is not __Canon, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also get here for __Canon[]
that it is perfectly fine to hardcode false for.
I understand that you are trying to reuse the existing JIT/EE interface APIs and flags in creative ways, but doing so often leads to bugs like #97134 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I assume for the same reason we shouldn't just try to check for well known cases here, like excluding arrays and pointers types? If we should add a new JIT/EE method for this, what other VM method should it be using instead, is there one that already does what we want to do here? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, introducing JIT/EE interface method that answers the exact question tends to work the best. It can be similar to the existing isEnum
method.
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Contributes to #96898
Codegen diffs:
Added tests but not entirely sure how to get diffs too 😅