-
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
[NativeAOT][8.0] Make casting logic closer to CoreCLR #90234
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsReduced version of #89548 (no JIT changes) Fixes: #84464 The actual changes are not as big here as might seem. For the most part this is a refactoring of existing code to have a shape closer to CoreCLR cast helpers, so that similar patterns could be used - in a few places where that has not been done already in earlier changes.
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -268,6 +274,17 @@ private static void LoadInvalidType() | |||
Console.WriteLine($"-- {typeof(ValueTypeWithInstanceMethod).Name}"); | |||
} | |||
|
|||
private static void TestCastsOptimizations() |
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 thought that this test needs a fix in the JIT and JIT/EE interface to pass.
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.
If we do not optimize isinst that classified as ANY, the test should pass.
The troubles start when array casts are classified as ANY, then we need to optimize ANY form of isinst , but ANY includes other subtle cases (equivalence, nullable) that are not optimizable and need to be sorted out.
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.
Note that array and ANY casts can end up calling the same helpers (helpers for ANY cases can handle array casts), but the initial classification is meaningful to the JIT when deciding what is optimizable.
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.
Ok, I see.
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.
Thank you!
Thanks!! |
Reduced version of #89548 (no JIT changes)
Fixes: #84464
The actual changes are not as big here as might seem. For the most part this is a refactoring of existing code to have a shape closer to CoreCLR cast helpers, so that similar patterns could be used - in a few places where that has not been done already in earlier changes.
For example cases like
CheckCastAny
- could start with a cache lookup, since uncached code path can be complex and thus relatively slow. (also addresses some old TODOs in this area)