-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Tracking issue for MIR (RFC #1211) #27840
Comments
PR #28748 enables MIR construction unconditionally. |
@nikomatsakis I've heard reports that unconditional MIR construction is leading to OOM for certain people. Is MIR construction going to also be enabled for the stable and beta releases? I'd hate for compiler perf to regress for 1.5-stable... |
@nikomatsakis Not just memory regression, but perf regression too:
To reiterate my question, is it safe to assume that we won't be turning on MIR construction unconditionally for 1.5-beta, even if we leave it on for 1.6-nightly? |
crate/commit in question for the above: nickel-org/nickel.rs@197aac3 It's still repro on latest nightly: |
@bstrie Good question. I was actually just debating now whether to land a
PR disabling construction without some sort of flag for that reason, since
I haven't had time to investigate and fix those regressions (which was of
course my preferred solution).
|
@Ryman the existing issue had to do with match translation, do you know if you have any match statements that have large sets of constants (or lots and lots of patterns)? For example: match foo {
1 | 2 | ... | 32767 => ...
...
} |
@nikomatsakis Ah, yeah we do, this expands into two decent sized matches. If I extracted that to another crate and re-exported the type I guess we'd lose the hit? |
@Ryman well ideally we'll just fix the codegen issue :) I'm not sure if On Mon, Oct 26, 2015 at 2:57 PM, Ryman notifications@github.com wrote:
|
@Ryman still that match doesn't quite fit the pattern I was expecting, I'll On Mon, Oct 26, 2015 at 3:07 PM, Nicholas Matsakis nmatsakis@mozilla.com
|
@nikomatsakis it looks like each of the |
@Ryman I was more thinking of matches against integer literals or other On Mon, Oct 26, 2015 at 4:58 PM, Ryman notifications@github.com wrote:
|
For overflow checking, there's a few options we go for handling it:
I don't mind 3) as it means we can separate out the overflowing and non-overflowing cases. This is good if want to be able to turn it on and off "arbitrarily". It also makes the control flow explicit in the MIR. |
@Aatch option 3 is what I had in mind. This maps precisely to what LLVM does, as well. I think that option 1 is a non-starter because translation no longer has knowledge of scopes or how to translate panics. Option 2 is probably overly limiting: option 3 gives us room to do optimizations like deferring the panic till after we collect various adjacent, pure operations. |
@nikomatsakis as an aside, deferring can be vectorized, reducing the slowdown on vectorized loops to around 2-3x (IIRC that's an order of magnitude better). If But LLVM can't do it by itself, since it requires vectorizing saturating arithmetic and LLVM doesn't have built-in saturating arithmetic, because if it did, it could vectorize it just like it can vectorize usual arithmetic. |
I think I know how I want to handle constants: have a mix between a EDIT: That idea didn't pan out, see #33130 for the pre-miri implementation. |
Speaking of constants, this is a bit of a worst-case: #![crate_type = "lib"]
#![feature(rustc_attrs)]
#[rustc_mir]
pub fn foo() -> [i32; 16] { [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] } Old trans does rvalue promotion everywhere which results in a beautiful single |
@eddyb it seems like this is something that the "constant promotion" code in MIR could handle, no? I'm a bit confused what distinguishes this particular case from other aggregates? (if anything) |
@nikomatsakis The promotion code is fine-tuned for enforcing semantics right now. @Doener Was it you who found that optimization difference between MIR and old trans, where old trans would promote a |
Unless I misunderstand what it means, the item "enable trans universally" in the OP should be marked done now. Is anything else in the OP already done? |
@solson I think we can close this tracking issue now. Doing so. |
There is a FIXME related to this issue, |
Tracking issue for transition to MIR (rust-lang/rfcs#1211).
Relevant discuss thread: https://internals.rust-lang.org/t/transitioning-to-mir/2706
Regressions
These are cases where building MIR is causing existing crates to stop working.
Refactorings
These are places where the design of MIR needs some tweaks. In some cases, the best course of action may be unclear or in active debate.
Other work
The text was updated successfully, but these errors were encountered: