-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Replace CorInfoIntrinsics with NamedIntrinsic #62639
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsThe remaining legacy In case of array functions, those appear without name, class and namespace in JIT's import, so it continues to rely on runtime support (which in turns relies on array's vtable). In the initial draft, it is hardwired end to end, until a better solution comes up in the review. I have kept that commit separate to easily drop it (if need be).
|
src/coreclr/vm/jitinterface.cpp
Outdated
@@ -4671,6 +4670,49 @@ unsigned CEEInfo::getArrayRank(CORINFO_CLASS_HANDLE cls) | |||
return result; | |||
} | |||
|
|||
/*********************************************************************/ | |||
// Get the index of runtime provided array method | |||
CorInfoArrayIntrinsic CEEInfo::getArrayFuncIndex(CORINFO_METHOD_HANDLE ftn) |
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.
Nit: getArrayFuncIndex -> getArrayIntrinsicID or something like that
diff from filtered JIT Dump:
mdarraytest code: var x = new int[2,2];
x[0,0] = 2;
x[1,0] = 1;
unsafe
{
fixed(int *y = &x[0,0])
{
Console.WriteLine("{0}, {1}, {2}, {3}", x.GetLowerBound(0), x.GetUpperBound(1), x[1,0], (IntPtr)y);
}
} difff with --- runtime_base/dump.log
+++ runtime_pr/dump.log
@@ -91,5 +91,2 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.ReadUnaligned: Not recognized
-Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.ReadUnaligned: Not recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.AddByteOffset: Not recognized
@@ -147,2 +144,5 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.ByteOffset: Not recognized
+Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
+Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
+Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.ReadUnaligned: Not recognized
Named Intrinsic System.StubHelpers.StubHelpers.GetStubContext: Recognized
@@ -213,3 +213,3 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Type.GetTypeFromHandle: Recognized
@@ -379,3 +379,3 @@
Named Intrinsic System.Runtime.InteropServices.MemoryMarshal.GetArrayDataReference: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Runtime.CompilerServices.RuntimeHelpers.IsBitwiseEquatable: Not recognized
@@ -384,3 +384,3 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.AddByteOffset: Not recognized
@@ -419,8 +419,8 @@
Named Intrinsic System.Collections.Generic.EqualityComparer`1.get_Default: Recognized
-Intrinsic CORINFO_INTRINSIC_Array_Set Recognized
-Intrinsic CORINFO_INTRINSIC_Array_Set Recognized
-Intrinsic CORINFO_INTRINSIC_Array_Address Recognized
+Named Intrinsic ARRAY_FUNC_SET: Recognized
+Named Intrinsic ARRAY_FUNC_SET: Recognized
+Named Intrinsic ARRAY_FUNC_ADDRESS: Recognized
Named Intrinsic System.Array.GetLowerBound: Recognized
Named Intrinsic System.Array.GetUpperBound: Recognized
-Intrinsic CORINFO_INTRINSIC_Array_Get Recognized
+Named Intrinsic ARRAY_FUNC_GET: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
@@ -443,5 +443,5 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Type.GetTypeFromHandle: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic System.StubHelpers.StubHelpers.GetStubContext: Recognized
@@ -449,5 +449,5 @@
Named Intrinsic System.String.get_Chars: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Type.GetTypeFromHandle: Recognized
@@ -456,8 +456,8 @@
Named Intrinsic System.Type.GetTypeFromHandle: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic System.ReadOnlySpan`1.get_Item: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
@@ -500,4 +500,4 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic System.String.get_Length: Recognized
@@ -505,3 +505,3 @@
Named Intrinsic System.String.get_Length: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
@@ -570,3 +570,3 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.As: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Type.GetTypeFromHandle: Recognized
@@ -574,6 +574,6 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.AsRef: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.AsRef: Not recognized
@@ -609,3 +609,3 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Object.GetType: Recognized
@@ -632,7 +632,7 @@
Named Intrinsic System.ReadOnlySpan`1.get_Item: Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.Add: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Ctor Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
+Named Intrinsic System.ByReference`1..ctor: Recognized
Named Intrinsic System.Threading.Volatile.Read: Not recognized
@@ -650,3 +650,3 @@
Named Intrinsic Internal.Runtime.CompilerServices.Unsafe.NullRef: Not recognized
-Intrinsic CORINFO_INTRINSIC_ByReference_Value Recognized
+Named Intrinsic System.ByReference`1.get_Value: Recognized
Named Intrinsic System.StubHelpers.StubHelpers.GetStubContext: Recognized |
03cd05f
to
1123afd
Compare
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.
LGTM! Thank you
@dotnet/jit-contrib Could somebody on JIT team please sign-off on this as a well? |
JIT side LGTM, @am11 I assume you ran It's great to see we got rid of I'm going to use your changes in my #62421, e.g. if arg is valuetype or "sealed" then |
@EgorBo, I offloaded the number crunching to GitHub Action worker, it just completed: https://github.com/am11/CrossRepoCITesting/runs/4493289569?check_suite_focus=true
and pmi has some errors in generating asm for special assemblies like DllImportGenerator.dll (possibly due to same reason that Microsoft.CodeAnalysis is not available. #62518?), so I sprinkled around a few
Here is the pmi verdict:
this scenario of gathering pmi diffs when JITEEVersionIdentifier changes is probably not very well handled by jitutils. I have also added a step in workflow script to upload artifacts (jit-diff directory), this job's artifacts are available here: https://github.com/am11/CrossRepoCITesting/releases/tag/jit-diffs_1567265287 (jit-diffs.tar.gz for further analysis). |
The remaining legacy
CORINFO_INTRINSIC_*
are dynamically identified by the runtime (without involving[Intrinsic]
attribute mechanism in managed code). They are converted to modernNamedIntrinsic
.In case of array functions, those appear without name, class and namespace in JIT's import, so it continues to rely on runtime support (which in turns relies on array's vtable). In the initial draft, it is hardwired end to end, until a better solution comes up in the review. I have kept that commit separate to easily drop it (if need be).