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
Merged

Add MIR Optimization Tests #34715

merged 1 commit into from
Jul 22, 2016

Conversation

scottcarr
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Contributor Author

r? @nikomatsakis

@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("/");
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Member

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
Copy link
Contributor Author

@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
Copy link
Member

@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");
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

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
Copy link
Contributor

But basically r+ from me

@scottcarr scottcarr changed the title [WIP] Add MIR Optimization Tests Add MIR Optimization Tests Jul 20, 2016
@scottcarr scottcarr force-pushed the mir-test branch 5 times, most recently from 36d589d to 1669574 Compare July 20, 2016 23:00
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 21, 2016

📌 Commit 8f9844d has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Jul 21, 2016

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

@bors
Copy link
Contributor

bors commented Jul 21, 2016

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

@alexcrichton
Copy link
Member

@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
Copy link
Contributor

bors commented Jul 21, 2016

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

@bors
Copy link
Contributor

bors commented Jul 21, 2016

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

@alexcrichton
Copy link
Member

@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
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
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
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.

7 participants