dotnet / dotnet/jitutils

Proposal: PMI asm diffs using SuperPMI

Open
#185 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
160
Forks
69
Avg merge
1h 56m
Merged PRs (30d)
1

Description

We now have `jit-diff diff --pmi` to use PMI for generating assembly code across a specified corpus of code, and analyzing the diffs assuming both baseline and diff compiler asm code is generated. This proposal is to introduce a mode to user SuperPMI to achieve the same results, but hopefully faster, eliminating incorrect diffs, and allowing for easier re-JIT of interesting methods.

I propose we add a `--superpmi` option, such that you would use `jit-diff diff --pmi --superpmi`. This specifies to still use PMI, but to accelerate it using SuperPMI. In this mode, you would be required to specify both a baseline and diff compiler (SuperPMI asm diffs require both). These steps would be executed:

- Run PMI over the specified corpus of code using the baseline compiler, in SuperPMI collection mode. We would not be generating textual asm output during this run.
- Do all the MC file cleanup and merging to create a single CODE.MCH file.
- Run SuperPMI in asm diff mode, passing both the baseline and diff JIT, and the CODE.MCH file, generating a DIFF.MCL file identifying all the functions that differ.
- If there are any diffs, generate textual ASM output (using `COMPlus_JitDisasm`) by running SuperPMI over just the DIFF.MCL methods, once for the baseline JIT, and once for the diff JIT.
- Run `jit-analyze` over the resulting ASM, to generate the diff statistics.

The resulting CODE.MCH and DIFF.MCL can remain for subsequent re-use and further investigations.

Note that we could also have a `jit-diff diff --superpmi` (without `--pmi`) for doing a similar thing but for crossgen-based asm diffs.

@dotnet/jit-contrib

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.