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

Add JitDisasmWithDebugInfo #61780

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Nov 18, 2021

  • Add COMPlus_JitDisasmWithDebugInfo. When set and in verbose/disasm mode,
    JIT will display inline comments with debug information before the
    instructions that debug info applies to. Change superpmi with
    --debuginfo to use this mode. Also small change to dotnet-pgo flow graph
    dump to write offsets in the same format.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 18, 2021
@ghost
Copy link

ghost commented Nov 18, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Add COMPlus_JitDisasmWithDebugInfo. When set and in verbose/disasm
    mode, JIT will display inline comments containing debug information
    before instructions marking that debug info. Change superpmi with
    --debuginfo to use this mode. Also small change to dotnet-pgo flow
    graph dump to write offsets in the same format.

  • Refactor CMake build for JIT to include headers and arch-specific
    headers in the same way as sources. This makes arch-specific headers
    appear in the correct standalone jit (clrjit_universel_arm64_x64 etc.)
    projects. Refactor some of the declarations in the emitter.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

Example of how this looks with superpmi asmdiffs --debuginfo for an upcoming change that fixes some cases where we lose debug info:

diff --git "a/C:\\dev\\dotnet\\spmi\\asm.benchmarks.run.windows.x64.checked.3\\base\\634.dasm" "b/C:\\dev\\dotnet\\spmi\\asm.benchmarks.run.windows.x64.checked.3\\diff\\634.dasm"
index e985c6e..675ed01 100644
--- "a/C:\\dev\\dotnet\\spmi\\asm.benchmarks.run.windows.x64.checked.3\\base\\634.dasm"
+++ "b/C:\\dev\\dotnet\\spmi\\asm.benchmarks.run.windows.x64.checked.3\\diff\\634.dasm"
@@ -25,6 +25,7 @@ G_M63213_IG01:        ; gcrefRegs=00000000 {}, byrefRegs=00000000 {}, byref, nog
        ; gcrRegs +[rsi]
 						;; bbWeight=1    PerfScore 4.50
 G_M63213_IG02:        ; gcrefRegs=00000040 {rsi}, byrefRegs=00000000 {}, byref
+       ; INLRT @ 0x000[E-]
        mov      edi, dword ptr [rsi+40]
        sub      edi, dword ptr [rsi+48]
        movsxd   rdx, edi
@@ -33,6 +34,7 @@ G_M63213_IG02:        ; gcrefRegs=00000040 {rsi}, byrefRegs=00000000 {}, byref
        ; gcr arg pop 0
        mov      rbx, rax
        ; gcrRegs +[rbx]
+       ; INL02 @ 0x000[E-] <- INLRT @ 0x00C[E-]
        mov      r9d, edi
        mov      rcx, rsi
        ; gcrRegs +[rcx]
@@ -42,6 +44,7 @@ G_M63213_IG02:        ; gcrefRegs=00000040 {rsi}, byrefRegs=00000000 {}, byref
        call     System.Collections.Generic.HashSet`1[__Canon][System.__Canon]:CopyTo()
        ; gcrRegs -[rax rcx rdx rsi]
        ; gcr arg pop 0
+       ; INLRT @ 0x013[E-]
        mov      rax, rbx
        ; gcrRegs +[rax]
 						;; bbWeight=1    PerfScore 8.75
@@ -70,8 +73,9 @@ Unwind Info:
     CodeOffset: 0x03 UnwindOp: UWOP_PUSH_NONVOL (0)     OpInfo: rbx (3)
     CodeOffset: 0x02 UnwindOp: UWOP_PUSH_NONVOL (0)     OpInfo: rsi (6)
     CodeOffset: 0x01 UnwindOp: UWOP_PUSH_NONVOL (0)     OpInfo: rdi (7)
-IP mapping count : 4
+IP mapping count : 5
 IL offs PROLOG : 0x00000000 ( STACK_EMPTY )
+IL offs 0x0000 : 0x0000000F ( STACK_EMPTY )
 IL offs 0x000C : 0x00000020 ( STACK_EMPTY )
 IL offs 0x0013 : 0x00000031 ( STACK_EMPTY )
 IL offs EPILOG : 0x00000034 ( STACK_EMPTY )

cc @dotnet/jit-contrib

@jakobbotsch
Copy link
Member Author

jakobbotsch commented Nov 18, 2021

I'll split out the CMake change from this PR.

EDIT: Opened #61800 for that.

Add COMPlus_JitDisasmWithDebugInfo. When set and in verbose/disasm mode,
JIT will display inline comments with debug information before the
instructions that debug info applies to. Change superpmi with
--debuginfo to use this mode. Also small change to dotnet-pgo flow graph
dump to write offsets in the same format.
@jakobbotsch jakobbotsch changed the title Add JitDisasmWithDebugInfo and small build refactoring Add JitDisasmWithDebugInfo Nov 18, 2021
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants