Skip to content

Tracking issue for MIR (RFC #1211) #27840

Closed
@nikomatsakis

Description

@nikomatsakis
Contributor

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

  • add overflow and division by zero checking
    constant propagation and hoisting
    port rvalue checking
    port dead-code pass
    port reachability
    port match checking to take place during MIR construction
    port effect checking
    port intrinsicck
    enable trans universally

Activity

steveklabnik

steveklabnik commented on Aug 18, 2015

@steveklabnik
Member
nikomatsakis

nikomatsakis commented on Sep 30, 2015

@nikomatsakis
ContributorAuthor

PR #28748 enables MIR construction unconditionally.

bstrie

bstrie commented on Oct 24, 2015

@bstrie
Contributor

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

bstrie

bstrie commented on Oct 26, 2015

@bstrie
Contributor

@nikomatsakis Not just memory regression, but perf regression too:

< Rym> Anyone know anything about the 'MIR Dump' pass and factors which might affect its speed?
<@bstrie> Rym: is it causing performance problems for you?
< Rym> bstrie: It's approximately 6 seconds of a 12second no-trans build (effectively doubling the time compared to a beta compiler, where it took <0.01s)

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?

Ryman

Ryman commented on Oct 26, 2015

@Ryman
Contributor

crate/commit in question for the above: nickel-org/nickel.rs@197aac3
rustc: rustc 1.5.0-nightly (1210fb9bc 2015-10-23)

It's still repro on latest nightly: rustc 1.5.0-nightly (c3db627cb 2015-10-26).
Same compiler has <0.2s 'MIR dump' for hyper, so I'm wondering if we're doing something particularly bad within nickel? Seems to bounce around between 4-6seconds.

nikomatsakis

nikomatsakis commented on Oct 26, 2015

@nikomatsakis
ContributorAuthor
nikomatsakis

nikomatsakis commented on Oct 26, 2015

@nikomatsakis
ContributorAuthor

@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 => ...
    ...
}
Ryman

Ryman commented on Oct 26, 2015

@Ryman
Contributor

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

nikomatsakis

nikomatsakis commented on Oct 26, 2015

@nikomatsakis
ContributorAuthor

@Ryman well ideally we'll just fix the codegen issue :) I'm not sure if
exporting it to another crate would help, except that you would only do it
once I guess. Anyway, I've just about got a PR that disables MIR on
beta/stable for now.

On Mon, Oct 26, 2015 at 2:57 PM, Ryman notifications@github.com wrote:

@nikomatsakis https://github.com/nikomatsakis Ah, yeah we do
https://github.com/nickel-org/nickel.rs/blob/master/src/mimes.rs, 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?


Reply to this email directly or view it on GitHub
#27840 (comment).

nikomatsakis

nikomatsakis commented on Oct 26, 2015

@nikomatsakis
ContributorAuthor

@Ryman still that match doesn't quite fit the pattern I was expecting, I'll
have to investigate more deeply.

On Mon, Oct 26, 2015 at 3:07 PM, Nicholas Matsakis nmatsakis@mozilla.com
wrote:

@Ryman well ideally we'll just fix the codegen issue :) I'm not sure if
exporting it to another crate would help, except that you would only do it
once I guess. Anyway, I've just about got a PR that disables MIR on
beta/stable for now.

On Mon, Oct 26, 2015 at 2:57 PM, Ryman notifications@github.com wrote:

@nikomatsakis https://github.com/nikomatsakis Ah, yeah we do
https://github.com/nickel-org/nickel.rs/blob/master/src/mimes.rs, 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?


Reply to this email directly or view it on GitHub
#27840 (comment).

Ryman

Ryman commented on Oct 26, 2015

@Ryman
Contributor

@nikomatsakis it looks like each of the derivings for that enum also result in huge matches against single tuple refs, e.g. (&Foo,) => { .. }. Would that fit the pattern more?

nikomatsakis

nikomatsakis commented on Oct 26, 2015

@nikomatsakis
ContributorAuthor

@Ryman I was more thinking of matches against integer literals or other
non-enum types.

On Mon, Oct 26, 2015 at 4:58 PM, Ryman notifications@github.com wrote:

@nikomatsakis https://github.com/nikomatsakis it looks like each of the
derivings for that enum also result in huge matches against single tuple
refs, e.g. (&Foo,) => { .. }. Would that fit the pattern more?


Reply to this email directly or view it on GitHub
#27840 (comment).

added
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
on Nov 4, 2015

14 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @solson@steveklabnik@eddyb@nikomatsakis@Aatch

        Issue actions

          Tracking issue for MIR (RFC #1211) · Issue #27840 · rust-lang/rust