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 Optimization Tests #34715

Merged
merged 1 commit into from Jul 22, 2016

Conversation

Projects
None yet
7 participants
@scottcarr
Copy link
Contributor

scottcarr commented Jul 7, 2016

I've starting working on the infrastructure for testing MIR optimizations.

The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jul 7, 2016

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@scottcarr

This comment has been minimized.

Copy link
Contributor Author

scottcarr commented Jul 7, 2016

@rust-highfive rust-highfive assigned nikomatsakis and unassigned aturon Jul 7, 2016

let file_name = format!("rustc.node{}{}.{}.{}.mir",
node_id, promotion_id, pass_name, disambiguator);
let _ = fs::File::create(&file_name).and_then(|mut file| {
file_path.push_str("/");

This comment has been minimized.

@rkruppe

rkruppe Jul 8, 2016

Member

Doesn't this mean that, if no path is specified, the MIR will be dumped into the root folter (/rustc.node[...].mir)? Using PathBuf can avoid that, and would be semantically more appropriate and more robust anyway.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 8, 2016

Makefile changes look good to me! Could you also be sure to update src/bootstrap/step.rs to ensure that rustbuild runs this compiletest test suite as well?

@scottcarr scottcarr force-pushed the scottcarr:mir-test branch from 52ccb6f to 482ec55 Jul 12, 2016

@scottcarr

This comment has been minimized.

Copy link
Contributor Author

scottcarr commented Jul 18, 2016

@alexcrichton is there a bot that runs rustbuild? I think the travis bot builds with make, right? I'm pretty sure I tested this with both build systems, but we could double check.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 18, 2016

@scottcarr all correct! I'm fine letting bors figure out the rest


let mir_dump_dir = self.get_mir_dump_dir();
if !mir_dump_dir.exists() {
fs::create_dir(mir_dump_dir.clone()).expect("the dir should exist");

This comment has been minimized.

@nikomatsakis

nikomatsakis Jul 18, 2016

Contributor

I think this should be the "racy" create-dir option, probably-- though I guess each test will be making disjoint directories, so maybe it's not needed.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jul 18, 2016

Can you maybe add the src/test/mir-dump directory (or whatever it is to be called) along with a README.md that just (briefly) explains how such a test should look?

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jul 18, 2016

But basically r+ from me

@scottcarr scottcarr force-pushed the scottcarr:mir-test branch from 4de1bae to d23e5cd Jul 20, 2016

@scottcarr scottcarr changed the title [WIP] Add MIR Optimization Tests Add MIR Optimization Tests Jul 20, 2016

@scottcarr scottcarr force-pushed the scottcarr:mir-test branch 5 times, most recently from 36d589d to 1669574 Jul 20, 2016

@scottcarr scottcarr force-pushed the scottcarr:mir-test branch from 1669574 to 8f9844d Jul 21, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jul 21, 2016

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 21, 2016

📌 Commit 8f9844d has been approved by nikomatsakis

bors added a commit that referenced this pull request Jul 21, 2016

Auto merge of #34715 - scottcarr:mir-test, r=nikomatsakis
Add MIR Optimization Tests

I've starting working on the infrastructure for testing MIR optimizations.

The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 21, 2016

⌛️ Testing commit 8f9844d with merge 6a8b9e9...

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 21, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 21, 2016

@bors: retry

On Thu, Jul 21, 2016 at 11:01 AM, bors notifications@github.com wrote:

💔 Test failed - auto-win-gnu-32-opt-rustbuild
https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt-rustbuild/builds/1885


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34715 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95C0thCFCxn17Gj5IzrLztHDgcb1Mks5qX7PvgaJpZM4JHmu_
.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 21, 2016

⌛️ Testing commit 8f9844d with merge 9121b49...

bors added a commit that referenced this pull request Jul 21, 2016

Auto merge of #34715 - scottcarr:mir-test, r=nikomatsakis
Add MIR Optimization Tests

I've starting working on the infrastructure for testing MIR optimizations.

The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 21, 2016

💔 Test failed - auto-win-gnu-32-opt

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 21, 2016

@bors: retry

On Thu, Jul 21, 2016 at 11:56 AM, bors notifications@github.com wrote:

💔 Test failed - auto-win-gnu-32-opt
https://buildbot.rust-lang.org/builders/auto-win-gnu-32-opt/builds/5016


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#34715 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAD95CA2YD4j4SV37V7R5-45nmt6DFCOks5qX8D5gaJpZM4JHmu_
.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jul 22, 2016

⌛️ Testing commit 8f9844d with merge d46ed83...

bors added a commit that referenced this pull request Jul 22, 2016

Auto merge of #34715 - scottcarr:mir-test, r=nikomatsakis
Add MIR Optimization Tests

I've starting working on the infrastructure for testing MIR optimizations.

The plan now is to have a set of test cases (written in Rust), compile them with -Z dump-mir, and check the MIR before and after each pass.

@bors bors merged commit 8f9844d into rust-lang:master Jul 22, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.