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

Make all mir optimizations respect the optimization fuel #77402

Closed
oli-obk opened this issue Oct 1, 2020 · 5 comments · Fixed by #79117
Closed

Make all mir optimizations respect the optimization fuel #77402

oli-obk opened this issue Oct 1, 2020 · 5 comments · Fixed by #79117
Assignees
Labels
A-mir-opt Area: MIR optimizations

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 1, 2020

Right now only inlining actually uses optimization fuel (-Zfuel=42). We should start adding it to all of our optimizations and requiring new optimizations to use it.

cc @rust-lang/wg-mir-opt

@oli-obk oli-obk added the A-mir-opt Area: MIR optimizations label Oct 1, 2020
@jonas-schievink
Copy link
Contributor

It is also used by:

  • Layout computation (the original use case)
  • Destination propagation

@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented Oct 1, 2020

Adding a paragraph to the MIR optimizations part of the rustc-dev-guide would help going forward I think.

@cjkenn
Copy link
Contributor

cjkenn commented Oct 16, 2020

Is there still interest in this? I'm new to this section of the compiler but this seems like a nice introduction to some mir passes. If I understand correctly, we need to add calls to tcx.consider_optimizing(...) in the appropriate places (ie. before the optimization is performed, not necessarily right at the start of the pass) for each pass in the transform crate? Or is there a different way to implement this?

@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 11, 2020

Sorry about the late response.

Yes, we still want this. I personally haven't used it before, so your guess is as good as mine, but what you wrote sounds reasonable. Ideally look at how other passes use it and then try to apply it to some pass that seems expensive

@cjkenn
Copy link
Contributor

cjkenn commented Nov 16, 2020

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants