Skip to content

feat(codegen): print pass diffs#1001

Draft
DaniPopes wants to merge 3 commits into
mainfrom
dani/pass-diffs
Draft

feat(codegen): print pass diffs#1001
DaniPopes wants to merge 3 commits into
mainfrom
dani/pass-diffs

Conversation

@DaniPopes

@DaniPopes DaniPopes commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

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-opt and evm-opt invocations retain their clean final-module output unless -Zpass-diff is requested, and --pipeline-default remains a clean pipeline snapshot. The current ui_test integration keeps its stdout normalization hooks private, so the expectations remain .stdout; Linguist attributes render pass snapshots as Diff and give .mir and .evmir files approximate Rust and Assembly highlighting.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant