Skip to content

Reduce MIR dump file count for MIR-opt tests - #110773

Merged
bors merged 1 commit into
rust-lang:masterfrom
mj10021:issue-109502-fix
May 5, 2023
Merged

Reduce MIR dump file count for MIR-opt tests#110773
bors merged 1 commit into
rust-lang:masterfrom
mj10021:issue-109502-fix

Conversation

@mj10021

Copy link
Copy Markdown
Contributor

As referenced in issue #109502 , mir-opt tests previously used the -Zdump-mir=all flag, which generates very large output. This PR only dumps the passes under test, greatly reducing dump output.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @oli-obk

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

@rustbotrustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 24, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obkoli-obk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a bunch of impl nits.

Please also add some comments explaining the new field and argument

Comment threadsrc/tools/compiletest/src/runtest.rs Outdated
Comment threadsrc/tools/compiletest/src/runtest.rs Outdated
Comment threadsrc/tools/compiletest/src/runtest.rs Outdated
Comment threadsrc/tools/miropt-test-tools/src/lib.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this magic number 3 mean? (Add the answer as a comment to the code)

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha got it, adding

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use rsplit and the nth(3) operation on the iterator

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the comment I added good or is there more info that is missing?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh sorry, github didn't send my comment because I used a review

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O no worries, thanks for the update 🙂

@mj10021
mj10021force-pushed the issue-109502-fix branch 2 times, most recently from fe36aec to 0812a49CompareApril 27, 2023 23:28

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use split_once here to avoid collecting or iterating

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use rsplit and the nth(3) operation on the iterator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh sorry, github didn't send my comment because I used a review

@mj10021
mj10021force-pushed the issue-109502-fix branch from 0812a49 to 1056ff3CompareMay 4, 2023 22:51
@rustbot

Copy link
Copy Markdown
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@mj10021

Copy link
Copy Markdown
ContributorAuthor

oops fixing

@mj10021
mj10021force-pushed the issue-109502-fix branch from 1056ff3 to c19959fCompareMay 4, 2023 22:56
@oli-obk

Copy link
Copy Markdown
Contributor

Thanks!

@bors r+ rollup

@bors

bors commented May 5, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit c19959f has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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 May 5, 2023
@Dylan-DPCDylan-DPC mentioned this pull request May 5, 2023
Comment on lines -350 to +351
let proc_res = self.compile_test(should_run, self.should_emit_metadata(pm));
let proc_res = self.compile_test(should_run, self.should_emit_metadata(pm), Vec::new());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing compile_test function at all, if in all places except one, last parameter will be Vec::new()? You can just add something like compile_test_with_passes and use it exactly in that one place.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, I'll make a follow up with that change


alloc1 (static: FOO, size: 8, align: 4) {
╾─alloc18─╼ 03 00 00 00 │ ╾──╼....
╾─alloc19─╼ 03 00 00 00 │ ╾──╼....

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this affects alloc numbers at all?

bors added a commit to rust-lang-ci/rust that referenced this pull request May 5, 2023
Rollup of 6 pull requests
Successful merges:
- rust-lang#103056 (Fix `checked_{add,sub}_duration` incorrectly returning `None` when `other` has more than `i64::MAX` seconds)
- rust-lang#108801 (Implement RFC 3348, `c"foo"` literals)
- rust-lang#110773 (Reduce MIR dump file count for MIR-opt tests)
- rust-lang#110876 (Added default target cpu to `--print target-cpus` output and updated docs)
- rust-lang#111068 (Improve check-cfg implementation)
- rust-lang#111238 (btree_map: `Cursor{,Mut}::peek_prev` must agree)
Failed merges:
- rust-lang#110694 (Implement builtin # syntax and use it for offset_of!(...))
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit de7e29e into rust-lang:masterMay 5, 2023
@rustbotrustbot added this to the 1.71.0 milestone May 5, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 6, 2023
…oli-obk
Issue 109502 follow up, remove unnecessary Vec::new() from compile_test()
As mentioned in comment on PR rust-lang#110773 , adding a separate function to pass the test passes into the `dump-mir` is a bit nicer
@mj10021
mj10021 deleted the issue-109502-fix branch November 1, 2024 22:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuiteArea: The testsuite used to check the correctness of rustcS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@mj10021@rustbot@rust-log-analyzer@oli-obk@bors@klensy