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

Add mir-opt tests to track MIR quality. #110713

Merged
merged 1 commit into from
Apr 24, 2023
Merged

Conversation

cjgillot
Copy link
Contributor

cc @scottmcm @saethlin

If you have other ideas, please say so.

@rustbot
Copy link
Collaborator

rustbot commented Apr 23, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 23, 2023
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the track-mir-opt branch 2 times, most recently from d02df82 to da7b3e1 Compare April 23, 2023 13:26
@bors
Copy link
Contributor

bors commented Apr 23, 2023

☔ The latest upstream changes (presumably #107404) made this pull request unmergeable. Please resolve the merge conflicts.

@saethlin
Copy link
Member

👍 I think this is a much better way to factor the MIR tests. We should clearly delineate the point of the various MIR tests we have, this has been a frequent point of confusion for me personally, and this is improving that.


-O makes me uncomfortable, because I strongly suspect most people do not use that build configuration, and just opt for Cargo's --release which by default is -Copt-level=3 not -Copt-level=2. Currently this has no impact on MIR opts, thought Inline does mention the enum:

(sess.opts.optimize == OptLevel::Default
|| sess.opts.optimize == OptLevel::Aggressive)

The fact that all the codegen tests use -O bothers me for the same reason, so on balance I think there is some space for saying let's use -O for now and if we want to use -Copt-level=3 swap all our optimization tests to that at once.


These tests are uncommonly fragile because they contain line and column numbers from the standard library implementation. If we start to accumulate tests along these lines and don't normalize or erase the line/column information from the tests we can expect any change to library/ to break these tests.

I'm actually not sure if the fact that we currently have line/column info is a bug, because looking carefully over the diff here, I see this:

        scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) { // at $DIR/range_iter.rs:21:14: 21:24
            debug self => _8;            // in scope 4 at $SRC_DIR/core/src/iter/range.rs:LL:COL

so it looks like something is trying to help out here, but mostly it isn't.

@scottmcm
Copy link
Member

This looks good to me.

It would be nice to have an option to also scrub the inlined locations -- especially for things from other crates -- but that's an existing thing that doesn't need to block adding and moving tests here. (And if they're too painful, we can always remove tests.)

r? @scottmcm
@bors r+ rollup=iffy (moves enough tests that conflicts seem likely)

@bors
Copy link
Contributor

bors commented Apr 24, 2023

📌 Commit 332b7f5 has been approved by scottmcm

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2023
@bors
Copy link
Contributor

bors commented Apr 24, 2023

⌛ Testing commit 332b7f5 with merge 253b727...

@bors
Copy link
Contributor

bors commented Apr 24, 2023

☀️ Test successful - checks-actions
Approved by: scottmcm
Pushing 253b727 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2023
@bors bors merged commit 253b727 into rust-lang:master Apr 24, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 24, 2023
@cjgillot cjgillot deleted the track-mir-opt branch April 24, 2023 21:01
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (253b727): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.6%, 0.6%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-3.6%, -3.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.6% [-3.6%, -3.6%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants