feat(codegen): print pass diffs#1001
Draft
DaniPopes wants to merge 3 commits into
Draft
Conversation
Print rustc-style before/after line diffs for MIR and EVM IR pass runs, including per-pass codegen dumps. Keep ui-test expectations as .stdout because its normalization hooks are private, and configure Linguist to render the snapshots as diffs.
Keep shared codegen pass printing unchanged and only emit before/after diffs from explicitly selected mir-opt and evm-opt passes. Preserve canonical EVM IR output when no pass is requested.
Gate pass diff output behind -Zpass-diff so direct mir-opt and evm-opt invocations retain their clean output by default. Capture and print a fresh before/after pair around every explicitly selected pass, matching rustc MIR test semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass test snapshots currently show only the resulting IR, which hides what each transformation changed. The MIR and EVM IR test modes now opt into
-Zpass-diff, which prints a rustc-style whole-file before/after diff for every explicitly selected pass, including the changed header line. A pass list produces a separate diff for each pass against the output of the preceding pass.Direct
mir-optandevm-optinvocations retain their clean final-module output unless-Zpass-diffis requested, and--pipeline-defaultremains a clean pipeline snapshot. The currentui_testintegration keeps its stdout normalization hooks private, so the expectations remain.stdout; Linguist attributes render pass snapshots as Diff and give.mirand.evmirfiles approximate Rust and Assembly highlighting.