-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[mir-opt] Introduce a new flag to enable experimental/unsound mir opts #76899
[mir-opt] Introduce a new flag to enable experimental/unsound mir opts #76899
Conversation
I would personally prefer
|
@oli-obk I tried to keep our MIR opt tests' output as close to the current ones as possible. Some of these passes run after copy-prop so the effects of it being disabled by default (even under mir-opt-level=2) show up as changes in the tests. If you think we should not add this flag to those tests and accept the changes instead, I'd be happy to do so. |
Maybe remove the flag again in a separate commit so we keep the changes separate? |
With that and the flag renamed to |
// FIXME(76740): This opt is buggy and can cause unsoundness.
Is "opt" short for option or optimization? It is used for option in the next line, so probably better to spell it out here.
|
@RalfJung I remember you felt quite strongly the option name should include "unsound". Does |
Is this option intended only for unsound passes or also that are buggy in other ways e.g., ICE? If the latter I would also include inlining pass. Recently when I evaluated mir-opt-level=2 on a different crates, rustc generally ICEd due to normalization issues in inliner or other issues exposed indirectly by inlining. The attempt to enable inlining in #75495 didn't fare any better. |
Originally, I was thinking this flag could handle both but now I'm thinking we should probably have two. The optimizations that have bugs which result in unsoundness are far worse than the ones that "just" ICE the compiler. |
☔ The latest upstream changes (presumably #72632) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
Yes I like that name. :) |
4f4cc60
to
3498511
Compare
@bors r=oli-obk |
📌 Commit 3498511 has been approved by |
…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
3498511
to
2c5f061
Compare
Rebased and resolved the failing test from the rollup. @bors r=oli-obk |
📌 Commit 2c5f061d187b346c7f9e229a53be41723164ec30 has been approved by |
☔ The latest upstream changes (presumably #76844) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
2c5f061
to
c653af8
Compare
Rebased @bors r=oli-obk |
📌 Commit c653af8 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
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