Skip to content

[JitDiff X64] [MichalPetryka] Fold null checks against known non-null values #750

Open

Description

@MihuBot

Job completed in 19 minutes 24 seconds.
dotnet/runtime#109164

Diffs

Found 264 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 39526165
Total bytes of diff: 39526160
Total bytes of delta: -5 (-0.00 % of base)
Total relative delta: -0.05
    diff is an improvement.
    relative diff is an improvement.


Top file improvements (bytes):
          -5 : System.Security.Cryptography.dasm (-0.00 % of base)

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

Top method improvements (bytes):
          -5 (-4.55 % of base) : System.Security.Cryptography.dasm - System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte (FullOpts)

Top method improvements (percentages):
          -5 (-4.55 % of base) : System.Security.Cryptography.dasm - System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte (FullOpts)

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

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

Artifacts:

Activity

  1. MihuBot commented on Oct 23, 2024

    @MihuBot
    OwnerAuthor

    Top method improvements

    -5 (-4.55 % of base) - System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte
     ; Assembly listing for method System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte (FullOpts)
     ; Emitting BLENDED_CODE for X64 with AVX - Unix
     ; FullOpts code
     ; optimized code
     ; rbp based frame
     ; partially interruptible
     ; No PGO data
     ; 0 inlinees with PGO data; 4 single block inlinees; 0 inlinees without PGO data
     ; Final local variable assignments
     ;
     ;  V00 arg0         [V00,T00] ( 10,  4.50)     ref  ->  rdi         class-hnd single-def <System.String>
    -;  V01 loc0         [V01,T01] (  4,  2.50)   ubyte  ->  rax        
    +;  V01 loc0         [V01,T01] (  3,  2   )   ubyte  ->  rax        
     ;# V02 OutArgs      [V02    ] (  1,  1   )  struct ( 0) [rsp+0x00]  do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
     ;* V03 tmp1         [V03    ] (  0,  0   )     ref  ->  zero-ref    single-def "spilling varStr"
     ;* V04 tmp2         [V04    ] (  0,  0   )     int  ->  zero-ref    "spilling unroll qmark"
     ;* V05 tmp3         [V05    ] (  0,  0   )     ref  ->  zero-ref    single-def "spilling varStr"
     ;* V06 tmp4         [V06    ] (  0,  0   )     int  ->  zero-ref    "spilling unroll qmark"
     ;
     ; Lcl frame size = 0
     
     G_M51753_IG01:
            push     rbp
            mov      rbp, rsp
     						;; size=4 bbWeight=1 PerfScore 1.25
     G_M51753_IG02:
            test     rdi, rdi
            je       SHORT G_M51753_IG04
     						;; size=5 bbWeight=1 PerfScore 1.25
     G_M51753_IG03:
            cmp      dword ptr [rdi+0x08], 7
            je       SHORT G_M51753_IG08
     						;; size=6 bbWeight=0.25 PerfScore 1.00
     G_M51753_IG04:
            test     rdi, rdi
    -       je       SHORT G_M51753_IG07
    +       je       SHORT G_M51753_IG09
     						;; size=5 bbWeight=0.50 PerfScore 0.62
     G_M51753_IG05:
            cmp      dword ptr [rdi+0x08], 7
    -       jne      SHORT G_M51753_IG07
    +       jne      SHORT G_M51753_IG09
     						;; size=6 bbWeight=0.25 PerfScore 1.00
     G_M51753_IG06:
            mov      rax, 0xD1FFAB1E
            xor      rax, qword ptr [rdi+0x0C]
            mov      rcx, 0xD1FFAB1E
            xor      rcx, qword ptr [rdi+0x12]
            or       rax, rcx
    -       je       SHORT G_M51753_IG10
    +       jne      SHORT G_M51753_IG09
     						;; size=33 bbWeight=0.12 PerfScore 0.97
     G_M51753_IG07:
    -       xor      eax, eax
    -       jmp      SHORT G_M51753_IG11
    -						;; size=4 bbWeight=0.50 PerfScore 1.12
    +       mov      eax, 1
    +       jmp      SHORT G_M51753_IG10
    +						;; size=7 bbWeight=0.50 PerfScore 1.12
     G_M51753_IG08:
            mov      rax, 0xD1FFAB1E
            xor      rax, qword ptr [rdi+0x0C]
            mov      rcx, 0xD1FFAB1E
            xor      rcx, qword ptr [rdi+0x12]
            or       rax, rcx
    -       jne      SHORT G_M51753_IG05
    -						;; size=33 bbWeight=0.12 PerfScore 0.97
    +       je       SHORT G_M51753_IG07
    +       jmp      SHORT G_M51753_IG05
    +						;; size=35 bbWeight=0.12 PerfScore 1.22
     G_M51753_IG09:
    -       mov      eax, 1
    -       jmp      SHORT G_M51753_IG11
    -						;; size=7 bbWeight=0.50 PerfScore 1.12
    +       xor      eax, eax
    +						;; size=2 bbWeight=0.50 PerfScore 0.12
     G_M51753_IG10:
    -       mov      eax, 1
    -						;; size=5 bbWeight=0.50 PerfScore 0.12
    -G_M51753_IG11:
            pop      rbp
            ret      
     						;; size=2 bbWeight=1 PerfScore 1.50
     
    -; Total bytes of code 110, prolog size 4, PerfScore 10.94, instruction count 29, allocated bytes for code 110 (MethodHash=dfbd35d6) for method System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte (FullOpts)
    +; Total bytes of code 105, prolog size 4, PerfScore 10.06, instruction count 28, allocated bytes for code 105 (MethodHash=dfbd35d6) for method System.Security.Cryptography.HashProviderDispenser:KmacSupported(System.String):ubyte (FullOpts)
     ; ============================================================
  2. MihuBot commented on Oct 23, 2024

    @MihuBot
    OwnerAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions