-
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] Turn on the ConstProp
pass by default
#66074
Conversation
@bors try |
Awaiting bors try build completion |
[experiment] Test ConstProp performance Experiment to see performance implications for turning on ConstProp for scalars. r? @ghost
☀️ Try build successful - checks-azure |
Queued 98da694 with parent 0d5264a, future comparison URL. |
Finished benchmarking try commit 98da694, comparison URL. |
@rfcbot poll I think we should turn on constant propagation unconditionally (so in release mode and additionally in debug mode) since it reduces the work that llvm has to do quite a bit. Right now there is no real degradation of the debugging experience, since the worst that happens to users is that In the future we may const prop function calls to Constant propagation does not propagate over user defined variables, only expressions (so MIR temporaries) are const propagated. This may change in the future, but we can reopen the debug info degradation question then. |
Team member @oli-obk has asked teams: T-compiler, for consensus on:
|
09d7ce8
to
db23021
Compare
Note that post-#56231 you don't even need to care about debuginfo or "temp vs var", all you have to do is leave assignments around and run the pass to remove dead locals (which won't remove locals that have debuginfo attached). |
@rfcbot reviewed |
1 similar comment
@rfcbot reviewed |
Are the numbers above already with constant propagation turned on for debug builds too? |
@michaelwoerister Yes, the results are with constant propagation turned on for both debug and release builds. |
…ovements, r=oli-obk [mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass Temporarily rebased on top of rust-lang#66074. The top 2 commits are new. r? @oli-obk
perf.rlo shows that running the `ConstProp` pass results in across-the-board wins regardless of debug or opt complilation mode. As a result, we're turning it on to get the compile time benefits. `ConstProp` doesn't currently intern the memory used by its `Machine` so we can't yet propagate allocations which is why `ConstProp::should_const_prop()` checks if the value being propagated is a scalar or not.
db23021
to
db5fc10
Compare
ConstProp
pass by default
This is ready for a final review. r? @oli-obk |
@bors r+ |
📌 Commit db5fc10 has been approved by |
…oli-obk [mir-opt] Turn on the `ConstProp` pass by default perf.rlo shows that running the `ConstProp` pass results in across-the-board wins regardless of debug or opt complilation mode. As a result, we're turning it on to get the compile time benefits.
Rollup of 13 pull requests Successful merges: - #65932 (download .tar.xz if python3 is used) - #66074 ([mir-opt] Turn on the `ConstProp` pass by default) - #66094 (Fix documentation for `Iterator::count()`.) - #66166 (rename cfg(rustdoc) into cfg(doc)) - #66227 (docs: Fix link to BufWriter::flush) - #66292 (add Result::map_or) - #66297 (Add a callback that allows compiler consumers to override queries.) - #66317 (Use a relative bindir for rustdoc to find rustc) - #66330 (Improve non-exhaustiveness handling in usefulness checking) - #66331 (Add some tests for fixed ICEs) - #66334 (Move Session fields to CrateStore) - #66335 (Move self-profile infrastructure to data structures) - #66337 (Remove dead code for encoding/decoding lint IDs) Failed merges: r? @ghost
…oli-obk [mir-opt] Turn on the `ConstProp` pass by default perf.rlo shows that running the `ConstProp` pass results in across-the-board wins regardless of debug or opt complilation mode. As a result, we're turning it on to get the compile time benefits.
@bors rollup=never |
Ping from Triage: Hi @wesleywiser I see #66342 was closed yesterday. Please update this PR when you have a chance. Thanks! |
@bors r=oli-obk |
📌 Commit db5fc10 has been approved by |
[mir-opt] Turn on the `ConstProp` pass by default perf.rlo shows that running the `ConstProp` pass results in across-the-board wins regardless of debug or opt complilation mode. As a result, we're turning it on to get the compile time benefits.
☀️ Test successful - checks-azure |
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
Rustup to rustc 1.41.0-nightly (35ef33a 2019-11-21) I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by messense/rustc-test#3 List of rustups: - rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely) - rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0) - rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`) - rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types) - rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default) changelog: none
perf.rlo shows that running the
ConstProp
pass results inacross-the-board wins regardless of debug or opt complilation mode. As a
result, we're turning it on to get the compile time benefits.