Skip to content

Conversation

@BrianBohe
Copy link
Member

@BrianBohe BrianBohe commented Oct 25, 2022

I took this code out of PR77289.

Before this PR we dumped the information reported to the vm followed by all the variables live ranges. These are practically the same information, so I am adding information to what is being reported, and removing the print of the variable live ranges. Leaving dumpLvaVariableLiveRanges for debug purposes.

Before:

*************** In genSetScopeInfo()
VarLocInfo count is 5
; Variable debug info: 4 live ranges, 3 vars for method System.DateTime:ToBinary():long:this
  0(   UNKNOWN) : From 00000000h to 00000008h, in rcx
  0(   UNKNOWN) : From 00000008h to 0000002Fh, in rsi
  4(   UNKNOWN) : From 00000035h to 0000004Eh, in rdx
  6(   UNKNOWN) : From 00000051h to 00000051h, in rcx
VARIABLE LIVE RANGES:
V00 this: rsi [8, 2F)
V04 loc3: rdx [35, 4E)
V06 loc5: rcx [51, 51); rcx [51, 51)
*************** In gcInfoBlockHdrSave()

After:

*************** In genSetScopeInfo()
VarLocInfo count is 5
; Variable debug info: 4 live ranges, 3 vars for method System.DateTime:ToBinary():long:this
V00 this(   UNKNOWN) : From 00000000h to 00000008h, in rcx
V00 this(   UNKNOWN) : From 00000008h to 0000002Fh, in rsi
V04 loc3(   UNKNOWN) : From 00000035h to 0000004Eh, in rdx
V06 loc5(   UNKNOWN) : From 00000051h to 00000051h, in rcx
*************** In gcInfoBlockHdrSave()

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 25, 2022
@ghost ghost assigned BrianBohe Oct 25, 2022
@ghost
Copy link

ghost commented Oct 25, 2022

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

Issue Details

Before this PR we dumped the information reported to the vm followed by all the variables live ranges. These are practically the same information, so I am adding information to what is being reported, and removing the print of the variable live ranges. Leaving dumpLvaVariableLiveRanges for debug purposes.

Before:

*************** In genSetScopeInfo()
VarLocInfo count is 5
; Variable debug info: 4 live ranges, 3 vars for method System.DateTime:ToBinary():long:this
  0(   UNKNOWN) : From 00000000h to 00000008h, in rcx
  0(   UNKNOWN) : From 00000008h to 0000002Fh, in rsi
  4(   UNKNOWN) : From 00000035h to 0000004Eh, in rdx
  6(   UNKNOWN) : From 00000051h to 00000051h, in rcx
VARIABLE LIVE RANGES:
V00 this: rsi [8, 2F)
V04 loc3: rdx [35, 4E)
V06 loc5: rcx [51, 51); rcx [51, 51)

After:
*************** In genSetScopeInfo()
VarLocInfo count is 5
; Variable debug info: 4 live ranges, 3 vars for method System.DateTime:ToBinary():long:this
V00 this( UNKNOWN) : From 00000000h to 00000008h, in rcx
V00 this( UNKNOWN) : From 00000008h to 0000002Fh, in rsi
V04 loc3( UNKNOWN) : From 00000035h to 0000004Eh, in rdx
V06 loc5( UNKNOWN) : From 00000051h to 00000051h, in rcx
*************** In gcInfoBlockHdrSave()

Author: BrianBohe
Assignees: BrianBohe
Labels:

area-CodeGen-coreclr

Milestone: -

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM but looks like the formatting job isn't happy.

@BrianBohe
Copy link
Member Author

BrianBohe commented Oct 28, 2022

@jakobbotsch I can't understand the problem. The error I find is:

2022-10-26T16:13:49.8915250Z /__t/dotnet/sdk/3.1.424/Microsoft.Common.CurrentVersion.targets(1177,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. [/tmp/tmpe0bhz7jf/jitutils/src/jit-dasm/jit-dasm.csproj]
2022-10-26T16:13:49.9997628Z ERROR: dotnet publish of ./src/jit-dasm failed.

But it is not happening in my other PRs.

@BrianBohe
Copy link
Member Author

I ran jit-format -f again on this branch and nothing changed.

@jakobbotsch
Copy link
Member

@jakobbotsch I can't understand the problem. The error I find is:

Ah, looks like you got caught in the jitutils TFM update (dotnet/jitutils#357). The problem in the pipeline was fixed by #77511

@BrianBohe BrianBohe closed this Oct 28, 2022
@BrianBohe BrianBohe reopened this Oct 28, 2022
@BrianBohe BrianBohe closed this Oct 28, 2022
@BrianBohe BrianBohe reopened this Oct 28, 2022
@BrianBohe BrianBohe merged commit ce1b61f into dotnet:main Oct 28, 2022
@EgorBo
Copy link
Member

EgorBo commented Oct 31, 2022

@BrianBohe looks like this broke JITDUMP, it fails for me with

*************** In genSetScopeInfo()
VarLocInfo count is 4
; Variable debug info: 4 live ranges, 1 vars for method Proga:Test1():System.Guid:this
V00 this(   UNKNOWN) : From 00000000h to 00000015h, in rcx
V00 this(   UNKNOWN) : From 00000015h to 00000047h, in rbp[16] (1 slot)

Assert failure(PID 9128 [0x000023a8], Thread: 32692 [0x7fb4]): Assertion failed 'varNum < lvaCount' in 'Proga:Test1():System.Guid:this' during 'Emit GC+EH tables' (IL size 6; hash 0xb04c3b00; Tier0)

    File: C:\prj\runtime-main\src\coreclr\jit\lclvars.cpp Line: 1548
    Image: C:\prj\runtime-main\artifacts\bin\coreclr\windows.x64.Checked\CoreRun.exe
ERROR:
Assert failure(PID 9128 [0x000023a8], Thread: 32692 [0x7fb4]): Assertion failed 'varNum < lvaCount' in 'Proga:Test1():System.Guid:this' during 'Emit GC+EH tables' (IL size 6; hash 0xb04c3b00; Tier0)

    File: C:\prj\runtime-main\src\coreclr\jit\lclvars.cpp Line: 1548
    Image: C:\prj\runtime-main\artifacts\bin\coreclr\windows.x64.Checked\CoreRun.exe

for a simple program:

unsafe class Proga
{
    static void Main()
    {
        for (int i = 0; i < 100; i++)
        {
            new Proga().Test1();
            Thread.Sleep(16);
        }
    }


    static  Guid g = Guid.NewGuid();

    [MethodImpl(MethodImplOptions.NoInlining)]
    Guid Test1() => g;
}

DOTNET_JitDump=Test1

Does not repro if I revert your changes by hands.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 1, 2022
@BrianBohe BrianBohe deleted the updating_variable_info_dump branch February 10, 2023 23:06
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.

3 participants