- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
[RISC-V] Print load immediate value in disassembly #114470
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
Conversation
…d print imm value in disasm
| Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch | 
| Diffs are based on 12,502 contexts (10,177 MinOpts, 2,325 FullOpts). Overall (+0 bytes)
 MinOpts (+0 bytes)
 FullOpts (+0 bytes)
 Example diffstest.mch+0 (0.00%) : 1.dasm - System.Runtime.CompilerServices.GenericsHelpers:ClassWithSlotAndModule(long,ulong):long (Instrumented Tier1)@@ -119,7 +119,7 @@ RWD08  	dq	000074CB4BAB17D2h
 RWD16  	dq	000074CB4BEA4BECh
 
 
-; Total bytes of code 328, prolog size 60, PerfScore 163.50, instruction count 68, allocated bytes for code 328 (MethodHash=b5296683) for method System.Runtime.CompilerServices.GenericsHelpers:ClassWithSlotAndModule(long,ulong):long (Instrumented Tier1)
+; Total bytes of code 328, prolog size 60, PerfScore 163.50, instruction count 64, allocated bytes for code 328 (MethodHash=b5296683) for method System.Runtime.CompilerServices.GenericsHelpers:ClassWithSlotAndModule(long,ulong):long (Instrumented Tier1)
 ; ============================================================
 
 Unwind Info:+0 (0.00%) : 17.dasm - __GeneratedMainWrapper:Main():int (Tier0)@@ -104,7 +104,7 @@ G_M2004_IG09:        ; bbWeight=1, funclet epilog, nogc, extend
             addi           sp, sp, 32
             ret						;; size=16 bbWeight=1 PerfScore 7.50
 
-; Total bytes of code 260, prolog size 32, PerfScore 115.00, instruction count 61, allocated bytes for code 260 (MethodHash=2a2bf82b) for method __GeneratedMainWrapper:Main():int (Tier0)
+; Total bytes of code 260, prolog size 32, PerfScore 115.00, instruction count 49, allocated bytes for code 260 (MethodHash=2a2bf82b) for method __GeneratedMainWrapper:Main():int (Tier0)
 ; ============================================================
 
 Unwind Info:+0 (0.00%) : 65.dasm - System.String:Ctor(ulong):System.String (Instrumented Tier1)@@ -132,7 +132,7 @@ RWD00  	dq	00007323F4AD42ECh
 RWD08  	dq	00007323F4AD42E8h
 
 
-; Total bytes of code 340, prolog size 24, PerfScore 64.09, instruction count 83, allocated bytes for code 340 (MethodHash=0f67cbd1) for method System.String:Ctor(ulong):System.String (Instrumented Tier1)
+; Total bytes of code 340, prolog size 24, PerfScore 64.09, instruction count 52, allocated bytes for code 340 (MethodHash=0f67cbd1) for method System.String:Ctor(ulong):System.String (Instrumented Tier1)
 ; ============================================================
 
 Unwind Info:+0 (0.00%) : 12496.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes:get_DeclaringSyntaxReferences():System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.SyntaxReference]:this (Instrumented Tier0)@@ -25,11 +25,11 @@ G_M22631_IG02:        ; bbWeight=1, gcrefRegs=0000 {}, byrefRegs=0000 {}, byref
             ld             a0, 0xD1FFAB1E(a0)
             beqz           a0, G_M22631_IG04
             lui            a0, 0xD1FFAB1E
-            ; gcrRegs -[a0]
             addiw          a0, a0, 0xD1FFAB1E
             slli           a0, a0, 13
             addi           a0, a0, 0xD1FFAB1E
             slli           a0, a0, 3
+            ; gcrRegs -[a0]
             lui            a1, 0xD1FFAB1E
             addiw          a1, a1, 0xD1FFAB1E
             slli           a1, a1, 12
@@ -85,7 +85,7 @@ RWD00  	dq	00007CAB40B89C78h
 RWD08  	dq	00007CAB41E7390Ch
 
 
-; Total bytes of code 212, prolog size 16, PerfScore 71.00, instruction count 51, allocated bytes for code 212 (MethodHash=428ca798) for method Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes:get_DeclaringSyntaxReferences():System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.SyntaxReference]:this (Instrumented Tier0)
+; Total bytes of code 212, prolog size 16, PerfScore 71.00, instruction count 31, allocated bytes for code 212 (MethodHash=428ca798) for method Microsoft.CodeAnalysis.CSharp.Symbols.SourceMethodSymbolWithAttributes:get_DeclaringSyntaxReferences():System.Collections.Immutable.ImmutableArray`1[Microsoft.CodeAnalysis.SyntaxReference]:this (Instrumented Tier0)
 ; ============================================================
 
 Unwind Info:+0 (0.00%) : 12384.dasm - Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions:ShouldCheckRequiredMembers(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol):ubyte (Tier1)@@ -218,7 +218,7 @@ G_M22420_IG19:        ; bbWeight=0.50, epilog, nogc, extend
 RWD00  	dq	00007CAB3FC1BDC8h
 
 
-; Total bytes of code 504, prolog size 28, PerfScore 103.30, instruction count 125, allocated bytes for code 504 (MethodHash=9bdfa86b) for method Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions:ShouldCheckRequiredMembers(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol):ubyte (Tier1)
+; Total bytes of code 504, prolog size 28, PerfScore 103.30, instruction count 97, allocated bytes for code 504 (MethodHash=9bdfa86b) for method Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions:ShouldCheckRequiredMembers(Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol):ubyte (Tier1)
 ; ============================================================
 
 Unwind Info:+0 (0.00%) : 12288.dasm - Microsoft.CodeAnalysis.Collections.OrderPreservingMultiDictionary`2[System.__Canon,System.__Canon]:Free():this (Instrumented Tier0)@@ -342,10 +342,10 @@ G_M52571_IG25:        ; bbWeight=1, gcrefRegs=0000 {}, byrefRegs=0000 {}, byref
             ld             a0, -88(fp)
             bnez           a0, G_M52571_IG27
             lui            a0, 0xD1FFAB1E
-            ; gcrRegs -[a0]
             addiw          a0, a0, 0xD1FFAB1E
             slli           a0, a0, 16
             addi           a0, a0, 0xD1FFAB1E
+            ; gcrRegs -[a0]
             lui            a1, 0xD1FFAB1E
             addiw          a1, a1, 0xD1FFAB1E
             slli           a1, a1, 12
@@ -461,7 +461,7 @@ RWD08  	dq	00007CAB41DCB3E8h
 RWD16  	dq	00007CABBA41EBC6h
 
 
-; Total bytes of code 1248, prolog size 60, PerfScore 453.26, instruction count 308, allocated bytes for code 1248 (MethodHash=8e8b32a4) for method Microsoft.CodeAnalysis.Collections.OrderPreservingMultiDictionary`2[System.__Canon,System.__Canon]:Free():this (Instrumented Tier0)
+; Total bytes of code 1248, prolog size 60, PerfScore 453.26, instruction count 217, allocated bytes for code 1248 (MethodHash=8e8b32a4) for method Microsoft.CodeAnalysis.Collections.OrderPreservingMultiDictionary`2[System.__Canon,System.__Canon]:Free():this (Instrumented Tier0)
 ; ============================================================
 
 Unwind Info:DetailsSize improvements/regressions per collection
 PerfScore improvements/regressions per collection
 Context information
 jit-analyze output | 
| RISC-V Release-CLR-VF2: 9532 / 9552 (99.79%)Release-CLR-VF2.md, Release-CLR-VF2.xml, testclr_output.tar.gz Build information and commandsGIT:  RISC-V Release-CLR-QEMU: 9532 / 9552 (99.79%)Release-CLR-QEMU.md, Release-CLR-QEMU.xml, testclr_output.tar.gz Build information and commandsGIT:  | 
| 5331560 is being scheduled for building and testingGIT:  {CONFIG}-CLR-tests FAILEDbuildinfo.json | 
| RISC-V Release-CLR-QEMU: 9532 / 9552 (99.79%)Release-CLR-QEMU.md, Release-CLR-QEMU.xml, testclr_output.tar.gz Build information and commandsGIT:  RISC-V Release-FX-QEMU: 626054 / 651127 (96.15%)Release-FX-QEMU.md, Release-FX-QEMU.xml, testfx_output.tar.gz Build information and commandsGIT:  | 
| Somehow the "Format jit codebase" check failed after pushing 96b8a19. Looking at the logs, it looks like an issue with the CI: 
 The attached patch file is also empty. | 
| I'm going to re-run the CI to ensure the format jobs aren't broken. | 
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. I'm worried there might be assumptions around the compiler than an instrDesc represents one instruction. I think there are already one or two exceptions (loop alignment and arm32 large branches come to mind) so maybe it's ok.
Changes in this PR:
instrDesc(by introducingINS_OPTS_I&instrDescLoadImm)See first note from @BruceForstall #113250 (comment) in the merged PR (although I decided to put the comment on the last instruction, is it better to put it at the first one as requested?)
C# source code:
Disassembly output:
Part of #84834, cc @dotnet/samsung