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

MIR optimization results in significantly increased compile time for a rustc-perf benchmark #68105

Closed
ktrianta opened this issue Jan 10, 2020 · 1 comment · Fixed by #99762
Closed
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-mir-opt Area: MIR optimizations I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ktrianta
Copy link
Contributor

In PR #66329 we created a MIR optimization pass that optimizes away unreachable basic blocks, i.e., basic blocks whose terminator kind is Unreachable.

Running on rustc_perfwe observed improvement in all benchmarks except unicode-normalization (avg ~3%) and deeply-nested-opt (avg: 740644.6%). A more complete analysis of the compile times can be found here and here. As explained by @bjorn3, for deeply-nested-opt the LLVM related queries are the ones slowing down, not anything inside rustc.

Until the root cause of the increase in compile times is found and fixed, we have made the optimization available only as a level 3 optimization.

@jonas-schievink jonas-schievink added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 10, 2020
@mati865
Copy link
Contributor

mati865 commented Jan 11, 2020

Could be interesting to test this PR with #67954 once it's more polished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-mir-opt Area: MIR optimizations I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants