Uh oh!
There was an error while loading. Please reload this page.
Intrinsify typeof(T).IsGenericType - #97148
Conversation
ghost
commented
Jan 18, 2024
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsContributes to #96898 Added tests but not entirely sure how to get diffs too 😅
|
527abd9 to
fa02580CompareSergio0694
commented
Jan 18, 2024
fa02580 to
afde0ceCompareSergio0694
commented
Jan 18, 2024
@MichalStrehovsky just making sure I'm following: so we don't need any NAOT-specific work for this nor for #97159? |
MichalStrehovsky
commented
Jan 18, 2024
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) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a12a551 to
a5c7e1bComparea5c7e1b to
eb2b3a9Compare| } | ||
| 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.
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.
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.
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.
ghost
commented
Feb 17, 2024
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 😅