Skip to content

[JitDiff X64] [xtqqczze] Avoid Unsafe.As in BitConverter #1019

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

Open
MihuBot opened this issue Feb 27, 2025 · 2 comments
Open

[JitDiff X64] [xtqqczze] Avoid Unsafe.As in BitConverter #1019

MihuBot opened this issue Feb 27, 2025 · 2 comments

Comments

@MihuBot
Copy link
Owner

MihuBot commented Feb 27, 2025

Job completed in 15 minutes 25 seconds (remote runner delay: 1 minute 14 seconds).
dotnet/runtime#112616

Diffs

Found 83 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 43801869
Total bytes of diff: 43801899
Total bytes of delta: 30 (0.00 % of base)
Total relative delta: 0.87
    diff is a regression.
    relative diff is a regression.


Top file regressions (bytes):
          30 : System.Private.CoreLib.dasm (0.00 % of base)

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

Top method regressions (bytes):
           6 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(ushort):ubyte[] (FullOpts) (2 methods)
           3 (7.32 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(double):ubyte[] (FullOpts)
           3 (6.98 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(float):ubyte[] (FullOpts)
           3 (10.71 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(int):ubyte[] (FullOpts)
           3 (10.00 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(long):ubyte[] (FullOpts)
           3 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(short):ubyte[] (FullOpts)
           3 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(System.Half):ubyte[] (FullOpts)
           3 (10.71 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(uint):ubyte[] (FullOpts)
           3 (10.00 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(ulong):ubyte[] (FullOpts)

Top method regressions (percentages):
           3 (10.71 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(int):ubyte[] (FullOpts)
           3 (10.71 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(uint):ubyte[] (FullOpts)
           3 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(short):ubyte[] (FullOpts)
           3 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(System.Half):ubyte[] (FullOpts)
           6 (10.34 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(ushort):ubyte[] (FullOpts) (2 methods)
           3 (10.00 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(long):ubyte[] (FullOpts)
           3 (10.00 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(ulong):ubyte[] (FullOpts)
           3 (7.32 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(double):ubyte[] (FullOpts)
           3 (6.98 % of base) : System.Private.CoreLib.dasm - System.BitConverter:GetBytes(float):ubyte[] (FullOpts)

9 total methods with Code Size differences (0 improved, 9 regressed), 248181 unchanged.

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

Artifacts:

@MihuBot
Copy link
Owner Author

MihuBot commented Feb 27, 2025

Top method regressions

6 (10.34 % of base) - System.BitConverter:GetBytes(ushort):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(ushort):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )  ushort  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )  ushort  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M13406_IG01:
        push     rbx
        mov      ebx, edi
 						;; size=3 bbWeight=1 PerfScore 1.25
 G_M13406_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 2
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      word  ptr [rax+0x10], bx
-						;; size=24 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      word  ptr [rcx], bx
+						;; size=27 bbWeight=1 PerfScore 3.00
 G_M13406_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 29, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 29 (MethodHash=3e0fcba1) for method System.BitConverter:GetBytes(ushort):ubyte[] (FullOpts)
+; Total bytes of code 32, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 32 (MethodHash=3e0fcba1) for method System.BitConverter:GetBytes(ushort):ubyte[] (FullOpts)
 ; ============================================================
3 (7.32 % of base) - System.BitConverter:GetBytes(double):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(double):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )  double  ->  [rsp+0x00]  single-def
+;  V00 arg0         [V00,T03] (  3,  3   )  double  ->  [rsp+0x00]  ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T01] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T02] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 8
 
 G_M20108_IG01:
        push     rax
        vmovsd   qword ptr [rsp], xmm0
 						;; size=6 bbWeight=1 PerfScore 2.00
 G_M20108_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 8
        call     CORINFO_HELP_NEWARR_1_VC
+       lea      rcx, bword ptr [rax+0x10]
        vmovsd   xmm0, qword ptr [rsp]
-       vmovsd   qword ptr [rax+0x10], xmm0
-						;; size=30 bbWeight=1 PerfScore 6.50
+       vmovsd   qword ptr [rcx], xmm0
+						;; size=33 bbWeight=1 PerfScore 7.00
 G_M20108_IG03:
        add      rsp, 8
        ret      
 						;; size=5 bbWeight=1 PerfScore 1.25
 
-; Total bytes of code 41, prolog size 1, PerfScore 9.75, instruction count 9, allocated bytes for code 41 (MethodHash=02c0b173) for method System.BitConverter:GetBytes(double):ubyte[] (FullOpts)
+; Total bytes of code 44, prolog size 1, PerfScore 10.25, instruction count 10, allocated bytes for code 44 (MethodHash=02c0b173) for method System.BitConverter:GetBytes(double):ubyte[] (FullOpts)
 ; ============================================================
3 (6.98 % of base) - System.BitConverter:GetBytes(float):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(float):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )   float  ->  [rsp+0x04]  single-def
+;  V00 arg0         [V00,T03] (  3,  3   )   float  ->  [rsp+0x04]  ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T01] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T02] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 8
 
 G_M32905_IG01:
        push     rax
        vmovss   dword ptr [rsp+0x04], xmm0
 						;; size=7 bbWeight=1 PerfScore 2.00
 G_M32905_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 4
        call     CORINFO_HELP_NEWARR_1_VC
+       lea      rcx, bword ptr [rax+0x10]
        vmovss   xmm0, dword ptr [rsp+0x04]
-       vmovss   dword ptr [rax+0x10], xmm0
-						;; size=31 bbWeight=1 PerfScore 6.50
+       vmovss   dword ptr [rcx], xmm0
+						;; size=34 bbWeight=1 PerfScore 7.00
 G_M32905_IG03:
        add      rsp, 8
        ret      
 						;; size=5 bbWeight=1 PerfScore 1.25
 
-; Total bytes of code 43, prolog size 1, PerfScore 9.75, instruction count 9, allocated bytes for code 43 (MethodHash=41997f76) for method System.BitConverter:GetBytes(float):ubyte[] (FullOpts)
+; Total bytes of code 46, prolog size 1, PerfScore 10.25, instruction count 10, allocated bytes for code 46 (MethodHash=41997f76) for method System.BitConverter:GetBytes(float):ubyte[] (FullOpts)
 ; ============================================================
3 (10.71 % of base) - System.BitConverter:GetBytes(int):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(int):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )     int  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )     int  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M15498_IG01:
        push     rbx
        mov      ebx, edi
 						;; size=3 bbWeight=1 PerfScore 1.25
 G_M15498_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 4
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      dword ptr [rax+0x10], ebx
-						;; size=23 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      dword ptr [rcx], ebx
+						;; size=26 bbWeight=1 PerfScore 3.00
 G_M15498_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 28, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 28 (MethodHash=a42dc375) for method System.BitConverter:GetBytes(int):ubyte[] (FullOpts)
+; Total bytes of code 31, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 31 (MethodHash=a42dc375) for method System.BitConverter:GetBytes(int):ubyte[] (FullOpts)
 ; ============================================================
3 (10.00 % of base) - System.BitConverter:GetBytes(long):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(long):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )    long  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )    long  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M3283_IG01:
        push     rbx
        mov      rbx, rdi
 						;; size=4 bbWeight=1 PerfScore 1.25
 G_M3283_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 8
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      qword ptr [rax+0x10], rbx
-						;; size=24 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      qword ptr [rcx], rbx
+						;; size=27 bbWeight=1 PerfScore 3.00
 G_M3283_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 30, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 30 (MethodHash=38e4f32c) for method System.BitConverter:GetBytes(long):ubyte[] (FullOpts)
+; Total bytes of code 33, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 33 (MethodHash=38e4f32c) for method System.BitConverter:GetBytes(long):ubyte[] (FullOpts)
 ; ============================================================
3 (10.34 % of base) - System.BitConverter:GetBytes(short):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(short):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )   short  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )   short  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M3563_IG01:
        push     rbx
        mov      ebx, edi
 						;; size=3 bbWeight=1 PerfScore 1.25
 G_M3563_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 2
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      word  ptr [rax+0x10], bx
-						;; size=24 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      word  ptr [rcx], bx
+						;; size=27 bbWeight=1 PerfScore 3.00
 G_M3563_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 29, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 29 (MethodHash=3b7df214) for method System.BitConverter:GetBytes(short):ubyte[] (FullOpts)
+; Total bytes of code 32, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 32 (MethodHash=3b7df214) for method System.BitConverter:GetBytes(short):ubyte[] (FullOpts)
 ; ============================================================
3 (10.34 % of base) - System.BitConverter:GetBytes(System.Half):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(System.Half):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;* V00 arg0         [V00    ] (  0,  0   )  struct ( 8) zero-ref    single-def <System.Half>
+;* V00 arg0         [V00    ] (  0,  0   )  struct ( 8) zero-ref    ld-addr-op single-def <System.Half>
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
-;  V03 tmp2         [V03,T01] (  2,  2   )  ushort  ->  rbx         single-def "field V00._value (fldOffset=0x0)" P-INDEP
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;  V07 tmp6         [V07,T01] (  2,  2   )  ushort  ->  rbx         single-def "field V00._value (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V09 tmp8         [V09    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V10 tmp9         [V10,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V11 tmp10        [V11,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V15 tmp14        [V15    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M29041_IG01:
        push     rbx
        mov      ebx, edi
 						;; size=3 bbWeight=1 PerfScore 1.25
 G_M29041_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 2
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      word  ptr [rax+0x10], bx
-						;; size=24 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      word  ptr [rcx], bx
+						;; size=27 bbWeight=1 PerfScore 3.00
 G_M29041_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 29, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 29 (MethodHash=95fd8e8e) for method System.BitConverter:GetBytes(System.Half):ubyte[] (FullOpts)
+; Total bytes of code 32, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 32 (MethodHash=95fd8e8e) for method System.BitConverter:GetBytes(System.Half):ubyte[] (FullOpts)
 ; ============================================================
3 (10.71 % of base) - System.BitConverter:GetBytes(uint):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(uint):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )     int  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )     int  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M58303_IG01:
        push     rbx
        mov      ebx, edi
 						;; size=3 bbWeight=1 PerfScore 1.25
 G_M58303_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 4
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      dword ptr [rax+0x10], ebx
-						;; size=23 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      dword ptr [rcx], ebx
+						;; size=26 bbWeight=1 PerfScore 3.00
 G_M58303_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 28, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 28 (MethodHash=14391c40) for method System.BitConverter:GetBytes(uint):ubyte[] (FullOpts)
+; Total bytes of code 31, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 31 (MethodHash=14391c40) for method System.BitConverter:GetBytes(uint):ubyte[] (FullOpts)
 ; ============================================================
3 (10.00 % of base) - System.BitConverter:GetBytes(ulong):ubyte[]
 ; Assembly listing for method System.BitConverter:GetBytes(ulong):ubyte[] (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rsp based frame
 ; partially interruptible
 ; No PGO data
+; 0 inlinees with PGO data; 2 single block inlinees; 2 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 arg0         [V00,T01] (  3,  3   )    long  ->  rbx         single-def
+;  V00 arg0         [V00,T01] (  3,  3   )    long  ->  rbx         ld-addr-op single-def
 ;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace" <Empty>
 ;  V02 tmp1         [V02,T00] (  3,  6   )     ref  ->  rax         class-hnd exact single-def "NewArr temp" <ubyte[]>
+;* V03 tmp2         [V03    ] (  0,  0   )  struct (16) zero-ref    "spilled call-like call argument" <System.Span`1[ubyte]>
+;* V04 tmp3         [V04    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp" <System.Span`1[ubyte]>
+;* V05 tmp4         [V05    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V06 tmp5         [V06    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "Inlining Arg" <System.Span`1[ubyte]>
+;* V07 tmp6         [V07    ] (  0,  0   )   byref  ->  zero-ref    "field V03._reference (fldOffset=0x0)" P-INDEP
+;* V08 tmp7         [V08    ] (  0,  0   )     int  ->  zero-ref    "field V03._length (fldOffset=0x8)" P-INDEP
+;  V09 tmp8         [V09,T02] (  2,  2   )   byref  ->  rcx         "field V04._reference (fldOffset=0x0)" P-INDEP
+;* V10 tmp9         [V10,T03] (  0,  0   )     int  ->  zero-ref    "field V04._length (fldOffset=0x8)" P-INDEP
+;* V11 tmp10        [V11    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V05._reference (fldOffset=0x0)" P-INDEP
+;* V12 tmp11        [V12    ] (  0,  0   )     int  ->  zero-ref    "field V05._length (fldOffset=0x8)" P-INDEP
+;* V13 tmp12        [V13    ] (  0,  0   )   byref  ->  zero-ref    single-def "field V06._reference (fldOffset=0x0)" P-INDEP
+;* V14 tmp13        [V14    ] (  0,  0   )     int  ->  zero-ref    "field V06._length (fldOffset=0x8)" P-INDEP
 ;
 ; Lcl frame size = 0
 
 G_M40710_IG01:
        push     rbx
        mov      rbx, rdi
 						;; size=4 bbWeight=1 PerfScore 1.25
 G_M40710_IG02:
        mov      rdi, 0xD1FFAB1E      ; ubyte[]
        mov      esi, 8
        call     CORINFO_HELP_NEWARR_1_VC
-       mov      qword ptr [rax+0x10], rbx
-						;; size=24 bbWeight=1 PerfScore 2.50
+       lea      rcx, bword ptr [rax+0x10]
+       mov      qword ptr [rcx], rbx
+						;; size=27 bbWeight=1 PerfScore 3.00
 G_M40710_IG03:
        pop      rbx
        ret      
 						;; size=2 bbWeight=1 PerfScore 1.50
 
-; Total bytes of code 30, prolog size 1, PerfScore 5.25, instruction count 8, allocated bytes for code 30 (MethodHash=e91b60f9) for method System.BitConverter:GetBytes(ulong):ubyte[] (FullOpts)
+; Total bytes of code 33, prolog size 1, PerfScore 5.75, instruction count 9, allocated bytes for code 33 (MethodHash=e91b60f9) for method System.BitConverter:GetBytes(ulong):ubyte[] (FullOpts)
 ; ============================================================

@MihuBot
Copy link
Owner Author

MihuBot commented Feb 27, 2025

@xtqqczze

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

1 participant