Skip to content
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

[MichalPetryka] Intrinsify Array GetArrayDataReference for SZ arrays #76

Open
MihuBot opened this issue Jul 4, 2023 · 2 comments
Open

Comments

@MihuBot
Copy link
Owner

MihuBot commented Jul 4, 2023

Build completed in 1 hour 57 minutes.
dotnet/runtime#87374

CoreLib diffs

Found 2 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6451497
Total bytes of diff: 6451461
Total bytes of delta: -36 (-0.00 % of base)
Total relative delta: -1.80
    diff is an improvement.
    relative diff is an improvement.


Top file improvements (bytes):
         -36 : System.Private.CoreLib.dasm (-0.00 % of base)

1 total files with Code Size differences (1 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)

Top method improvements (percentages):
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)

6 total methods with Code Size differences (6 improved, 0 regressed), 52391 unchanged.

--------------------------------------------------------------------------------

Frameworks diffs

Diffs
Found 258 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 37836672
Total bytes of diff: 37836636
Total bytes of delta: -36 (-0.00 % of base)
Total relative delta: -1.80
    diff is an improvement.
    relative diff is an improvement.


Top file improvements (bytes):
         -36 : System.Private.CoreLib.dasm (-0.00 % of base)

1 total files with Code Size differences (1 improved, 0 regressed), 255 unchanged.

Top method improvements (bytes):
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)

Top method improvements (percentages):
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
          -6 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)

6 total methods with Code Size differences (6 improved, 0 regressed), 232941 unchanged.

--------------------------------------------------------------------------------

Artifacts:

@MihuBot
Copy link
Owner Author

MihuBot commented Jul 5, 2023

Top method improvements

-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M54100_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M54100_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M54100_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M54100_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M54100_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M54100_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M54100_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=33252cab) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=33252cab) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[double,long]:GetPinnableReference(ulong[]):byref (FullOpts)
-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M44274_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M44274_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M44274_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M44274_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M44274_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M44274_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M44274_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=78b3530d) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=78b3530d) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[int,long]:GetPinnableReference(ulong[]):byref (FullOpts)
-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M27755_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M27755_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M27755_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M27755_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M27755_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M27755_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M27755_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=1eeb9394) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=1eeb9394) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[long,long]:GetPinnableReference(ulong[]):byref (FullOpts)
-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M3059_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M3059_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M3059_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M3059_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M3059_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M3059_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M3059_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=4012f40c) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=4012f40c) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[short,long]:GetPinnableReference(ulong[]):byref (FullOpts)
-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M13410_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M13410_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M13410_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M13410_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M13410_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M13410_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M13410_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=84f6cb9d) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=84f6cb9d) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[System.Numerics.Vector`1[float],long]:GetPinnableReference(ulong[]):byref (FullOpts)
-6 (-30.00 % of base) - System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref
 ; Assembly listing for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
-; 0 inlinees with PGO data; 2 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T00] (  5,  4   )     ref  ->  rdi         class-hnd single-def
+;  V00 arg0         [V00,T00] (  4,  4   )     ref  ->  rdi         class-hnd single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
-;* V02 tmp1         [V02    ] (  0,  0   )   byref  ->  zero-ref    "impAppendStmt"
 ;
 ; Lcl frame size = 0
 
 G_M26878_IG01:
 						;; size=0 bbWeight=1 PerfScore 0.00
 G_M26878_IG02:
+       lea      rax, bword ptr [rdi+10H]
+       xor      rcx, rcx
        test     rdi, rdi
-       jne      SHORT G_M26878_IG05
-						;; size=5 bbWeight=1 PerfScore 1.25
+       cmove    rax, rcx
+						;; size=13 bbWeight=1 PerfScore 1.25
 G_M26878_IG03:
-       xor      rax, rax
-						;; size=2 bbWeight=0.50 PerfScore 0.12
-G_M26878_IG04:
        ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
-G_M26878_IG05:
-       mov      rax, qword ptr [rdi]
-       mov      eax, dword ptr [rax+04H]
-       lea      rax, bword ptr [rdi+rax-08H]
-						;; size=11 bbWeight=0.50 PerfScore 2.50
-G_M26878_IG06:
-       ret      
-						;; size=1 bbWeight=0.50 PerfScore 0.50
+						;; size=1 bbWeight=1 PerfScore 1.00
 
-; Total bytes of code 20, prolog size 0, PerfScore 6.88, instruction count 8, allocated bytes for code 20 (MethodHash=31f69701) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)
+; Total bytes of code 14, prolog size 0, PerfScore 3.65, instruction count 5, allocated bytes for code 14 (MethodHash=31f69701) for method System.Runtime.InteropServices.Marshalling.PointerArrayMarshaller`2+ManagedToUnmanagedIn[ubyte,long]:GetPinnableReference(ulong[]):byref (FullOpts)

@MihaZupan
Copy link
Collaborator

cc: @MichalPetryka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants