Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSwitch to MIR-based translation by default. #34096
Conversation
eddyb
added
the
relnotes
label
Jun 5, 2016
rust-highfive
assigned
pnkfelix
Jun 5, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ I feel like approving this PR for nightly makes a lot of sense. We’ve been testing and improving MIR for a while now and making it default on nightly will get MIR to many more hands than we had before so far. One concern I have that as the PR is now its pretty easy to forget to flip the I hope time this PR will need to go through the queue will be enough for all relevant parties to see this. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Sure. We have to flip that switch someday, and it's not like we will discover any new bugs with the switch set to off. On the other hand, I would prefer a crater run with LLVM assertions enabled. I would prefer that to a dump of confusing ICE reports. There are only 3 PRs left on the queue, and our build times improved since the |
This comment has been minimized.
This comment has been minimized.
|
hold hold hold canceling pending a crater run |
This comment has been minimized.
This comment has been minimized.
|
… and niko’s seal of approval, of course, which implies |
rust-highfive
assigned
nikomatsakis
and unassigned
pnkfelix
Jun 5, 2016
This comment has been minimized.
This comment has been minimized.
|
Whoa, how about #33828? |
This comment has been minimized.
This comment has been minimized.
|
I personally do not see performance regressions as a blocker to enable MIR in nightly by default, because otherwise we will never end up enabling it at all. Rather, enabling MIR by default on nightly would serve to help collect more reports on issues with MIR (both performance and correctness) and speed up fixing said issues. Perhaps all within the same cycle. |
This comment has been minimized.
This comment has been minimized.
|
@alexbool Those numbers predate non-zeroing drops. I can take a look, I suppose, maybe it has a completely different reason. |
This comment has been minimized.
This comment has been minimized.
|
@eddyb How is that related to non-zeroing drops? If I get it right, MIR and old code both use the same zeroing drops in that benchmark, so the competion is fair. (Please tell me if I am wrong) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks, sounds convincing |
This comment has been minimized.
This comment has been minimized.
|
The Travis failure is strange, although likely legitimate:
@alexcrichton Is it possible |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton The example seems fundamentally broken and only happens to work with old trans because no landing pads get generated for that exact code. Although the fix appears to be simple so I'll just include it here. |
This comment has been minimized.
This comment has been minimized.
|
@eddyb oh we probably don't pass @eddyb also yeah I'm fine with mangling that test or otherwise just ignoring it, it seems like a difficult thing to test anyway. Having it as part of rustdoc also probably isn't helping us much... |
This comment has been minimized.
This comment has been minimized.
|
Let's discuss a bit here perhaps: http://internals.rust-lang.org/t/enabling-mir-by-default/3555 ? |
This comment has been minimized.
This comment has been minimized.
|
@NastyRigger I have one data point for (compiler) memory usage: |
eddyb
referenced this pull request
Jun 6, 2016
Merged
[MIR] Fix MIR trans edge cases that showed up on crater. #34128
bors
added a commit
that referenced
this pull request
Jun 7, 2016
eddyb
referenced this pull request
Jun 7, 2016
Merged
Drive trans from the output of the translation item collector #33890
This comment has been minimized.
This comment has been minimized.
Once MIR is on the likelyhood of us turning it back on seems very low, so I have to disagree with this. We must hold the line on performance - we have already regressed compile time performance badly this year. Do we have evidence that compile time, run time and code size are on par with oldtrans? |
This comment has been minimized.
This comment has been minimized.
MagaTailor
commented
Jun 7, 2016
•
|
@eddyb @brson I remember comparing binary sizes of During the latter test Edit: Cargo binary is made 8% smaller. |
This comment has been minimized.
This comment has been minimized.
|
@brson Actually, I mentioned libsyntax using less memory to compile, here's the timings/RSS:
LLVM spends 26 seconds less optimizing the result of trans and uses 20 MBs less of RAM, at the cost of one extra second spent in MIR translation (which could be some missing caching on type/trait stuff). |
This comment has been minimized.
This comment has been minimized.
|
Will old trans be tested by Buildbot after this PR is merged? |
This comment has been minimized.
This comment has been minimized.
|
@sanxiyn Good question. We could technically flip the MIR bots to be "anti-MIR". cc @alexcrichton |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton As explained in the PR description, both |
This comment has been minimized.
This comment has been minimized.
|
Clearly I also need a PR to read more things, thanks @eddyb! |
This comment has been minimized.
This comment has been minimized.
|
I'm going to close this just to help clear out the queue, but the progress for this is tracked on https://github.com/rust-lang/rust/milestone/29 |
alexcrichton
closed this
Jul 19, 2016
eddyb
reopened this
Aug 1, 2016
eddyb
force-pushed the
eddyb:launch
branch
from
714763d
to
d2f2df1
Aug 1, 2016
This comment has been minimized.
This comment has been minimized.
|
After some discussion on IRC, we decided to go forward with this -- MIR is looking good, with no known functional regressions, and we're ready to see how it fares with the broader, nightly audience. =) As @eddyb wrote, albeit for a different nightly:
I think that last part may be a bit optimistic, but then... here's hoping. =) |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Aug 1, 2016
This comment has been minimized.
This comment has been minimized.
|
|
eddyb
force-pushed the
eddyb:launch
branch
from
d2f2df1
to
5985090
Aug 2, 2016
eddyb
added some commits
Jun 8, 2016
eddyb
force-pushed the
eddyb:launch
branch
from
6a4494f
to
b583711
Aug 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=nikomatsakis |
This comment has been minimized.
This comment has been minimized.
|
|
eddyb commentedJun 5, 2016
•
edited
This patch makes
-Z orbitdefault to "on", which means that by default, functions will be translated from Rust to LLVM IR through the upcoming MIR backend, instead of the antiquated AST backend.This switch is made possible by the recently merged #33622, #33905 and smaller fixes.
If you experience any issues, please file a report for each of them. You can switch to the old backend to work around problems by either setting
RUSTFLAGS="-Zorbit=off"or by annotating specific functions with#[rustc_no_mir](which requires#![feature(rustc_attrs)]at the crate-level).I would like this PR to get into nightly soon so that we can get early feedback in this release cycle and focus on correctness fixes and performance improvements, with the potential for removing the old backend implementation before beta branches off.
cc @rust-lang/compiler