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

No MIR optimisations with no-trans #41423

Open
leonardo-m opened this Issue Apr 20, 2017 · 7 comments

Comments

Projects
None yet
8 participants
@leonardo-m
Copy link

leonardo-m commented Apr 20, 2017

This is an enhancement request. When I compile the code with "-Z no-trans" to just verify the types and perform the borrow checking, I have seen with "-Ztime-passes" that it also performs (on my code, a large single file module):

time: 0.127; rss: 177MB MIR optimisations

Is it possible and a good idea for "-Z no-trans" to remove this part too? The gain is not a lot (about 0.13 seconds on about 3.5 seconds) but if this optimization is simple to implement, I think it's worth it, because I'm using no-trans often enough to test the code.

@eddyb eddyb added the T-compiler label Apr 20, 2017

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Apr 20, 2017

cc @rust-lang/compiler Should we do this? Not by treating MIR optimizations as part of "trans" but by not optimizing the MIR that doesn't end up in the crate metadata.

@eddyb eddyb added the I-nominated label Apr 21, 2017

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 21, 2017

@eddyb I would think that we want the optimized MIR in the metadata, since if we have to inline across crates, we don't want to optimize again, right?

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Apr 21, 2017

@nikomatsakis Right, but we only put MIR in the metadata if it's needed across crates.
We could even do some reachability analysis to reduce that number.

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Apr 21, 2017

Two points. I believe -Z no-trans is not the way to do the "check". It is --emit=metadata now. And for --emit=metadata it is what @nikomatsakis said.

I feel like this is one of the things that could be automatically solved as we make more stuff on-demand.

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Apr 27, 2017

On-demand compilation could significantly change the story here. Let's wait for it.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 27, 2017

triage: P-low

We are still working out the story around mir optimizations and the query system. Once that is more sorted, we can revisit this question. We're barely doing any MIR optimization now anyhow.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jan 28, 2019

Triage: no changes that I'm aware of

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.