rust-lang / rust-lang/compiler-team

Revisit MIR opt levels

Open
#579 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted meeting-proposal
Dominant language
HTML
Stars
433
Forks
73
Avg merge
1m
Merged PRs (30d)
1

Description

Meeting proposal info

  • Title: Revisit MIR opt levels
  • Type: technical

Summary

The current system of MIR opt levels 0-4 is suboptimal, in part because there is confusion what the individual levels mean. As we continue to add new MIR optimizations and revise existing ones, we should take the chance to improve the opt level system.

One potential option is to remove the levels entirely and derive what passes and (and to what strength or complexity) from other options the user has provided such as -Copt-level and -Cdebuginfo. If there are additional axis that are important to capture, other flags could be introduced for those.

Another option is to redefine the opt levels. Having four levels is confusing as it doesn't intuitively map to the 0-2 levels provided by -Copt-level (although that flag also has s and z opt levels which are not present in MIR opt levels at all). We could decide to redefine MIR opt levels to be 0-2 based. One challenge here is defining what the levels themselves mean (when does an optimization fall into opt level 1 or opt level 2?).

Prior discussions:

About this issue

This issue corresponds to a meeting proposal for the compiler team
steering meeting. It corresponds to a possible topic of
discussion. You can read more about the steering meeting procedure
here
.

Comment policy

These issues are meant to be used as an "announcements channel"
regarding the proposal, and not as a place to discuss the technical
details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision.
In the meantime, if you have questions or ideas, ping the proposers
on Zulip (or elsewhere).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MIR opt-level proposal and review the linked Zulip discussions and rust-lang/rust#103657 comment for prior context. The issue is a steering-meeting topic rather than an implementation task; work is complete when the compiler team reaches and records a decision about the opt-level design.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.