-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Faster compile times for release builds with small fix #44655
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
Comments
the stage1 compilation of rustc went from 828.89 to 691.75 secs with this fix on my computer but that is only a 15% improvement |
15% is pretty significant. |
Wow, great work! |
@andjo403: That's some nice improvements! If you feel up to it, go ahead an submit a pull request with your suggested changes. That way someone with experience with LLVM is guaranteed to look at the patch and it won't get lost. |
I believe the PR should be targeted at https://github.com/rust-lang/llvm. |
@leodasvacas: 👍 @andjo403: If you want to push through this patch the general process works like this:
If you have any questions about the process or want someone else to do this, just mention it here or contact me or someone else on one of the Rust IRC channels. |
cc @arielb1 |
cc #33299 |
Ideally, the process should include discussion with upstream LLVM too. |
Faster compile times for release builds with llvm fix Run global optimizations after the inliner to avoid spending time on optimizing dead code. fixes #44655
Unfortunately it looks like we were a bit too eager to close this in #45054 :( |
From what I have learned from the llvm maintainers I think that we have received the improvement that can be expected. The to good to be true improvements I measured was probably due to less optimizations was possible and resulted in less optimized code. |
Was looking at the printout of llvm passes when I noticed that the functions that was inlined everywhere, and due to this was dead code, was optimized more after inlining.
So as a test I added
MPM.add(createGlobalDCEPass());
at the line PassManagerBuilder.cpp#L480 and this reduces the compile time of release build in racer by an average of 23%.I do not know if this is a good place to add this extra pass but maybe someone that knows how llvm works can use this information to speedup the compilation of release builds.
was also wondering how this works in MIR I see that there is an inline pass but I can not find any dead code elimination
The text was updated successfully, but these errors were encountered: