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

Update coredistools #96286

Merged
merged 7 commits into from
Jan 3, 2024
Merged

Conversation

BruceForstall
Copy link
Member

@BruceForstall BruceForstall commented Dec 23, 2023

Update to the 1.4.0 version of the coredistools package.

Also, implement a basic late disassembler for RyuJIT based on
coredistools (previously, this depended on closed-source msvcdis).

Various changes:

  1. Remove unused AddressMap in SPMI. Removed a bunch of cases in
    the NearDiffer that were using it.
  2. Change arm64 emitter unit tests to not require verbose
  3. Always build in the late disassembler under DEBUG. It's only
    used when JitLateDisasm is set.
  4. Implement new arm32 callback mechanism for movw/movt handling
    in the NearDiffer.

Update to the 1.2.0 version of the coredistools package.

Also, implement a basic late disassembler for RyuJIT based on
coredistools (previously, this depended on closed-source msvcdis).

Various changes:
1. Remove unused AddressMap in SPMI. Removed a bunch of cases in
the NearDiffer that were using it.
2. Change arm64 emitter unit tests to not require `verbose`
3. Always build in the late disassembler under DEBUG. It's only
used when `JitLateDisasm` is set.
4. Implement new arm32 callback mechanism for movw/movt handling
in the NearDiffer.
@BruceForstall BruceForstall marked this pull request as draft December 23, 2023 08:19
@ghost ghost assigned BruceForstall Dec 23, 2023
@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 Dec 23, 2023
@ghost
Copy link

ghost commented Dec 23, 2023

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

Issue Details

Update to the 1.2.0 version of the coredistools package.

Also, implement a basic late disassembler for RyuJIT based on
coredistools (previously, this depended on closed-source msvcdis).

Various changes:

  1. Remove unused AddressMap in SPMI. Removed a bunch of cases in
    the NearDiffer that were using it.
  2. Change arm64 emitter unit tests to not require verbose
  3. Always build in the late disassembler under DEBUG. It's only
    used when JitLateDisasm is set.
  4. Implement new arm32 callback mechanism for movw/movt handling
    in the NearDiffer.
Author: BruceForstall
Assignees: BruceForstall
Labels:

area-CodeGen-coreclr

Milestone: -

1. Fix Risc-V build: only build LATE_DISASM for platforms where
coredistool support exists.
2. Defer load and initialization of coredistools.dll library for
LATE_DISASM until we actually need it.
3. For arm64, in late disasm, if there is a failure, try to recover
by skipping one 4-byte instruction.
@BruceForstall
Copy link
Member Author

/azp run runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BruceForstall
Copy link
Member Author

/azp run runtime-coreclr gcstress0x3-gcstress0xc

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BruceForstall BruceForstall marked this pull request as ready for review December 30, 2023 01:47
@BruceForstall
Copy link
Member Author

gcstress pipeline failure is #96364

@BruceForstall
Copy link
Member Author

BruceForstall commented Jan 2, 2024

@jakobbotsch @dotnet/jit-contrib PTAL

Note this includes changes to work with the 1.4.0 coredistools, but it will also work with the existing 1.1.0 coredistools.

Changing everyone to use 1.4.0 is #96291. This still has some problem with linux-x64 gcstress.

The rebuild of cordistools to 1.4.0 is dotnet/jitutils#370. This build still fails in CI with linux-x64 and linux-arm64, but those have been manually built and packaged into an uploaded 1.4.0 coredistools.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

Just reviewed changes in jit folder and they looks good except for few questions/suggestions.

src/coreclr/jit/disasm.cpp Show resolved Hide resolved
src/coreclr/jit/disasm.cpp Outdated Show resolved Hide resolved
src/coreclr/jit/disasm.cpp Outdated Show resolved Hide resolved
src/coreclr/jit/disasm.cpp Show resolved Hide resolved
src/coreclr/jit/codegenlinear.cpp Show resolved Hide resolved
In particular, only load the coredistools library once, not
once per function to disassemble.
@BruceForstall
Copy link
Member Author

superpmi pipeline failures are due to missing osx-arm64 MCH files due to new spmi collection

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr superpmi-replay, runtime-coreclr superpmi-diffs

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@@ -37,6 +38,8 @@

/*****************************************************************************/

#ifdef USE_MSVCDIS
Copy link
Member

Choose a reason for hiding this comment

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

Do we ever use MSVCDIS? Can we remove all of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

We currently don't, but we could resurrect the code and use it. It shouldn't be too hard to do so, and there might be benefits. The only downside is it's not open source. So I'd prefer to just leave it.

Comment on lines +407 to +409
#if 0
// We might want to do something similar for mov/movk/movk/movk sequences on Arm64. The following code was
// previously used, but currently is not active.
Copy link
Member

Choose a reason for hiding this comment

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

Delete the code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not convinced yet that we don't need (or will never need) this, so I think it's worth leaving.

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

@BruceForstall BruceForstall merged commit 5455432 into dotnet:main Jan 3, 2024
129 checks passed
@BruceForstall BruceForstall deleted the UpdateCoredistools branch January 3, 2024 16:57
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2024
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