Repository navigation
Annotate MIR with dataflow results for testing purposes - #163721
Conversation
To avoid name conflicts with dataflow directory (to be added in subsequent commit).
|
Some changes occurred in compiler/rustc_attr_ir cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
r? @tiif rustbot has assigned @tiif. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Should this also use a |
|
Is there something specific you would like to see implemented? I could try to include it in all MIR dumps, in a fixed stage, or at configurable point, ... . Alternatively, one could also teach compiletest to dump the complete MIR as opposed to merely checking it. |
| _ => {} | ||
| } | ||
| } | ||
| annotations.into_extra_data() |
There was a problem hiding this comment.
| annotations.into_extra_data() | |
| let extra_data = annotations.into_extra_data()?; | |
| if let Some(dumper) = MirDumper::new(tcx, "DataflowPretty", body) { | |
| dumper.set_extra_data(&*extra_data).dump_mir(body); | |
| } | |
| Some(extra_data) |
This allows the tests to contain full snapshots of the annotated MIR with:
// EMIT_MIR liveness.fields.DataflowPretty.0.mirThere was a problem hiding this comment.
OK. Added with a different suffix "dataflow".
This is simpler from what I had in mind. There is a drawback that it couples -Zdump-mir and --emit mir together. That is, dumping dataflow results individually requires emitting the complete MIR.
When requested through an internal rustc attribute, include dataflow results in MIR output, i.e., `-Zunpretty=mir` or `--emit mir`. For now, supported dataflows are: * `#[rustc_mir(rustc_pretty_live_locals)]` * `#[rustc_mir(rustc_pretty_transitive_live_locals)]` The mechanism is intended to supersede existing `rustc_peek` intrinsic. For demonstration also migrates one of tests based on `rustc_peek`: tests/ui/mir-dataflow/liveness-projection.rs.
2e4f92b to
3b3e098
Compare
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 2822155 (parent) -> 260f1ac (this PR) Test differencesShow 16 test diffsStage 1
Stage 2
Additionally, 10 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 260f1acad9d7f70b5b56a636a9dc5a7f76150417 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (260f1ac): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.1%, secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary 19.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.206s -> 490.682s (0.30%) |
When requested through an internal rustc attribute, include dataflow
results in MIR output, i.e.,
-Zunpretty=miror--emit mir.For now, supported dataflows are:
#[rustc_mir(rustc_pretty_live_locals)]#[rustc_mir(rustc_pretty_transitive_live_locals)]The mechanism is intended to supersede existing
rustc_peekintrinsic.For demonstration also migrates one of tests based on
rustc_peek:tests/ui/mir-dataflow/liveness-projection.rs.