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

[JitDiff X64] [xtqqczze] Simplify boolean logic in TimeZoneInfo #975

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

[JitDiff X64] [xtqqczze] Simplify boolean logic in TimeZoneInfo #975

MihuBot opened this issue Feb 1, 2025 · 2 comments

Comments

@MihuBot
Copy link
Owner

MihuBot commented Feb 1, 2025

Job completed in 15 minutes 18 seconds (remote runner delay: 1 minute 23 seconds).
dotnet/runtime#112062

Diffs

Found 84 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 43608351
Total bytes of diff: 43608353
Total bytes of delta: 2 (0.00 % of base)
Total relative delta: 0.01
    diff is a regression.
    relative diff is a regression.


Top file regressions (bytes):
           2 : 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):
           2 (0.78 % of base) : System.Private.CoreLib.dasm - System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this (FullOpts)

Top method regressions (percentages):
           2 (0.78 % of base) : System.Private.CoreLib.dasm - System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this (FullOpts)

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

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

Artifacts:

@MihuBot
Copy link
Owner Author

MihuBot commented Feb 1, 2025

Top method regressions

2 (0.78 % of base) - System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this
 ; Assembly listing for method System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this (FullOpts)
 ; Emitting BLENDED_CODE for X64 with AVX512 - Unix
 ; FullOpts code
 ; optimized code
 ; rbp based frame
 ; partially interruptible
 ; No PGO data
 ; 0 inlinees with PGO data; 1 single block inlinees; 0 inlinees without PGO data
 ; Final local variable assignments
 ;
-;  V00 this         [V00,T00] ( 11, 11   )     ref  ->  rbx         this class-hnd single-def <System.TimeZoneInfo>
-;  V01 arg1         [V01,T02] (  4,  4   )     ref  ->  r15         class-hnd single-def <System.String>
+;  V00 this         [V00,T00] ( 11, 10.50)     ref  ->  rbx         this class-hnd single-def <System.TimeZoneInfo>
+;  V01 arg1         [V01,T01] (  4,  4   )     ref  ->  r15         class-hnd single-def <System.String>
 ;* V02 arg2         [V02    ] (  0,  0   )  struct ( 8) zero-ref    single-def <System.TimeSpan>
-;  V03 arg3         [V03,T03] (  3,  3   )     ref  ->  r14         class-hnd single-def <System.String>
-;  V04 arg4         [V04,T04] (  3,  3   )     ref  ->  r13         class-hnd single-def <System.String>
-;  V05 arg5         [V05,T05] (  3,  3   )     ref  ->  r12         class-hnd single-def <System.String>
+;  V03 arg3         [V03,T02] (  3,  3   )     ref  ->  r14         class-hnd single-def <System.String>
+;  V04 arg4         [V04,T03] (  3,  3   )     ref  ->  r13         class-hnd single-def <System.String>
+;  V05 arg5         [V05,T04] (  3,  3   )     ref  ->  r12         class-hnd single-def <System.String>
 ;  V06 arg6         [V06,T10] (  2,  2   )     ref  ->  [rbp+0x10]  class-hnd single-def <System.TimeZoneInfo+AdjustmentRule[]>
 ;  V07 arg7         [V07,T12] (  2,  1.50)   ubyte  ->  [rbp+0x18]  single-def
-;  V08 arg8         [V08,T13] (  1,  0.50)   ubyte  ->  [rbp+0x20]  single-def
+;  V08 arg8         [V08,T13] (  1,  1   )   ubyte  ->  [rbp+0x20]  single-def
 ;  V09 loc0         [V09    ] (  2,  2   )   ubyte  ->  [rbp-0x30]  do-not-enreg[X] addr-exposed ld-addr-op
 ;# V10 OutArgs      [V10    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
 ;* V11 tmp1         [V11    ] (  0,  0   )     ref  ->  zero-ref   
 ;* V12 tmp2         [V12    ] (  0,  0   )     ref  ->  zero-ref    single-def
 ;  V13 tmp3         [V13,T11] (  2,  2   )     ref  ->  rsi        
 ;* V14 tmp4         [V14    ] (  0,  0   )     ref  ->  zero-ref   
 ;* V15 tmp5         [V15    ] (  0,  0   )     ref  ->  zero-ref    single-def
-;  V16 tmp6         [V16,T08] (  3,  2   )     int  ->  rdi        
-;  V17 tmp7         [V17,T01] (  4,  8   )     ref  ->  rax         single-def "spilling varStr"
-;  V18 tmp8         [V18,T07] (  2,  4   )     int  ->  rax         "spilling unroll qmark"
-;* V19 tmp9         [V19    ] (  0,  0   )     ref  ->  zero-ref   
-;* V20 tmp10        [V20    ] (  0,  0   )     ref  ->  zero-ref    single-def
-;  V21 tmp11        [V21,T09] (  3,  2   )     int  ->  rax        
-;  V22 tmp12        [V22,T06] (  3,  3   )    long  ->  [rbp-0x38]  single-def "field V02._ticks (fldOffset=0x0)" P-INDEP
+;  V16 tmp6         [V16,T07] (  3,  2   )     int  ->  rdi        
+;* V17 tmp7         [V17    ] (  0,  0   )     ref  ->  zero-ref    single-def
+;* V18 tmp8         [V18    ] (  0,  0   )     ref  ->  zero-ref   
+;  V19 tmp9         [V19,T08] (  3,  2   )     int  ->  rax        
+;  V20 tmp10        [V20,T06] (  4,  3   )     ref  ->  rax         single-def "spilling varStr"
+;  V21 tmp11        [V21,T09] (  3,  2   )     int  ->  rax         "spilling unroll qmark"
+;  V22 tmp12        [V22,T05] (  3,  3   )    long  ->  [rbp-0x38]  single-def "field V02._ticks (fldOffset=0x0)" P-INDEP
 ;
 ; Lcl frame size = 24
 
 G_M6955_IG01:
        push     rbp
        push     r15
        push     r14
        push     r13
        push     r12
        push     rbx
        sub      rsp, 24
        lea      rbp, [rsp+0x40]
        mov      rbx, rdi
        mov      r15, rsi
        mov      rax, rdx
        mov      r14, rcx
        mov      r13, r8
        mov      r12, r9
        mov      r8, gword ptr [rbp+0x10]
 						;; size=41 bbWeight=1 PerfScore 9.25
 G_M6955_IG02:
        lea      rcx, [rbp-0x30]
        mov      rdi, r15
        mov      qword ptr [rbp-0x38], rax
        mov      rsi, rax
        mov      gword ptr [rbp+0x10], r8
        mov      rdx, r8
        mov      r10, 0xD1FFAB1E      ; code for System.TimeZoneInfo:ValidateTimeZoneInfo(System.String,System.TimeSpan,System.TimeZoneInfo+AdjustmentRule[],byref)
        call     [r10]System.TimeZoneInfo:ValidateTimeZoneInfo(System.String,System.TimeSpan,System.TimeZoneInfo+AdjustmentRule[],byref)
        lea      rdi, bword ptr [rbx+0x08]
        mov      rsi, r15
        call     CORINFO_HELP_ASSIGN_REF
        mov      r15, qword ptr [rbp-0x38]
        mov      qword ptr [rbx+0x50], r15
        lea      rdi, bword ptr [rbx+0x10]
        mov      rsi, r14
        call     CORINFO_HELP_ASSIGN_REF
        lea      rdi, bword ptr [rbx+0x18]
        mov      rsi, r13
        call     CORINFO_HELP_ASSIGN_REF
        xor      rsi, rsi
        movzx    r15, byte  ptr [rbp+0x18]
        test     r15b, r15b
        cmove    rsi, r12
        lea      rdi, bword ptr [rbx+0x20]
        call     CORINFO_HELP_ASSIGN_REF
        cmp      byte  ptr [rbp-0x30], 0
        jne      SHORT G_M6955_IG04
 						;; size=107 bbWeight=1 PerfScore 20.00
 G_M6955_IG03:
        xor      edi, edi
        jmp      SHORT G_M6955_IG05
 						;; size=4 bbWeight=0.50 PerfScore 1.12
 G_M6955_IG04:
        test     r15b, r15b
        sete     dil
        movzx    rdi, dil
 						;; size=11 bbWeight=0.50 PerfScore 0.75
 G_M6955_IG05:
        mov      byte  ptr [rbx+0x48], dil
        lea      rdi, bword ptr [rbx+0x28]
        mov      rsi, gword ptr [rbp+0x10]
        call     CORINFO_HELP_ASSIGN_REF
+       cmp      byte  ptr [rbp+0x20], 0
+       je       SHORT G_M6955_IG07
+						;; size=23 bbWeight=1 PerfScore 6.50
+G_M6955_IG06:
+       mov      eax, 1
+       jmp      SHORT G_M6955_IG10
+						;; size=7 bbWeight=0.50 PerfScore 1.12
+G_M6955_IG07:
        mov      rax, gword ptr [rbx+0x08]
        cmp      dword ptr [rax+0x08], 3
-       jne      SHORT G_M6955_IG07
+       je       SHORT G_M6955_IG09
+						;; size=10 bbWeight=0.50 PerfScore 3.00
+G_M6955_IG08:
+       xor      eax, eax
+       jmp      SHORT G_M6955_IG10
+						;; size=4 bbWeight=0.25 PerfScore 0.56
+G_M6955_IG09:
        mov      ecx, dword ptr [rax+0x0C]
        or       ecx, 0xD1FFAB1E
        xor      ecx, 0xD1FFAB1E
        movzx    rax, word  ptr [rax+0x10]
        or       eax, 32
        xor      eax, 99
        or       eax, ecx
        sete     al
        movzx    rax, al
-       test     eax, eax
-       je       SHORT G_M6955_IG07
-						;; size=64 bbWeight=1 PerfScore 17.25
-G_M6955_IG06:
-       mov      eax, 1
-       jmp      SHORT G_M6955_IG08
-						;; size=7 bbWeight=0.50 PerfScore 1.12
-G_M6955_IG07:
-       movzx    rax, byte  ptr [rbp+0x20]
-						;; size=4 bbWeight=0.50 PerfScore 0.50
-G_M6955_IG08:
+						;; size=33 bbWeight=0.25 PerfScore 1.62
+G_M6955_IG10:
        mov      byte  ptr [rbx+0x49], al
 						;; size=3 bbWeight=1 PerfScore 1.00
-G_M6955_IG09:
+G_M6955_IG11:
        add      rsp, 24
        pop      rbx
        pop      r12
        pop      r13
        pop      r14
        pop      r15
        pop      rbp
        ret      
 						;; size=15 bbWeight=1 PerfScore 4.25
 
-; Total bytes of code 256, prolog size 19, PerfScore 55.25, instruction count 77, allocated bytes for code 256 (MethodHash=5823e4d4) for method System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this (FullOpts)
+; Total bytes of code 258, prolog size 19, PerfScore 49.19, instruction count 78, allocated bytes for code 258 (MethodHash=5823e4d4) for method System.TimeZoneInfo:.ctor(System.String,System.TimeSpan,System.String,System.String,System.String,System.TimeZoneInfo+AdjustmentRule[],ubyte,ubyte):this (FullOpts)
 ; ============================================================

@MihuBot
Copy link
Owner Author

MihuBot commented Feb 1, 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