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

-Zmir-opt-level Reform #319

Closed
1 of 3 tasks
wesleywiser opened this issue Jun 23, 2020 · 4 comments
Closed
1 of 3 tasks

-Zmir-opt-level Reform #319

wesleywiser opened this issue Jun 23, 2020 · 4 comments
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@wesleywiser
Copy link
Member

wesleywiser commented Jun 23, 2020

-Zmir-opt-level Reform

Summary

Change the -Zmir-opt-level unstable flag to have the following possible values and associated behaviors:

  • 0 - MIR optimizations are disabled.
  • 1 - Some MIR optimizations are enabled.
    • This would be the default if -Zmir-opt-level is not specified.
    • Optimizations ran at this level would be selected based on their ability to improve compilation performance.
    • Optimizations ran should not hurt the debug-ability of programs.
  • 2 - Many (most?) MIR optimizations are enabled.
    • Optimizations ran at this level would include any passes that improve or have no significant adverse effect on compilation performance.
    • Optimizations ran would not be required to maintain the debug-ability of programs.
  • 3 - All non-experimental MIR optimizations are enabled.
    • Optimizations ran at this level may have negative impacts on compilation performance provided there is some run-time benefit.
    • As with mir-opt-level=2, optimizations would not be required to maintain the debug-ability of programs.

In addition, a new permanently unstable compiler flag is added: -Zexperimental-mir-optimizations. MIR optimizations that are still being developed or are currently too buggy to be enabled are gated under this flag which allows them to still be maintained in-tree and participate in the mir-opt testing framework.

Rationale

Currently, -Zmir-opt-level is kind of a mess.

By changing -Zmir-opt-level so that we do not run experimental/broken MIR optimizations, we can eventually allow --release builds to use mir-opt-level=2 and even potentially stablize the flag, allowing stable users to opt-in to mir-opt-level=3 for cases where run-time performance is the highest priority. This MCP does not propose doing that at this time, but notes that it would be reasonable to consider those possibilities in the future if this MCP were accepted.

Mentors or Reviewers

@oli-obk has volunteered to review.

Process

The main points of the Major Change Process is as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@wesleywiser wesleywiser added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jun 23, 2020
@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2020

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jun 23, 2020
@jonas-schievink
Copy link
Contributor

@rustbot second

@rustbot
Copy link
Collaborator

rustbot commented Jun 23, 2020

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jun 23, 2020
@RalfJung

This comment has been minimized.

@spastorino spastorino removed the to-announce Announce this issue on triage meeting label Jun 24, 2020
@spastorino spastorino added major-change-accepted A major change proposal that was accepted and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Jul 8, 2020
@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jul 8, 2020
@spastorino spastorino removed the to-announce Announce this issue on triage meeting label Jul 8, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Sep 22, 2020
…r_opts_flag, r=oli-obk

[mir-opt] Introduce a new flag to enable experimental/unsound mir opts

This implements part of rust-lang/compiler-team#319. The exact name of this flag was not decided as part of that MCP and some people expressed that it should include "unsound" in some way.

I've chosen to use `enable-experimental-unsound-mir-opts` as the name. While long, I don't think that matters too much as really it will only be used by some mir-opt tests. If you object or have a better name, please leave a comment!

r? @oli-obk
cc @rust-lang/wg-mir-opt @RalfJung
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 28, 2020
…opts_flag, r=oli-obk

[mir-opt] Introduce a new flag to enable experimental/unsound mir opts

This implements part of rust-lang/compiler-team#319. The exact name of this flag was not decided as part of that MCP and some people expressed that it should include "unsound" in some way.

I've chosen to use `enable-experimental-unsound-mir-opts` as the name. While long, I don't think that matters too much as really it will only be used by some mir-opt tests. If you object or have a better name, please leave a comment!

r? `@oli-obk`
cc `@rust-lang/wg-mir-opt` `@RalfJung`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

5 participants