-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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
oyvindln, larros, cramertj, stefson, StefanoD and 1 morecramertj, kennytm and StefanoDjonas-schievink, TimNN, cramertj, aturon, qmx and 2 more
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
andjo403 commentedon Sep 17, 2017
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
oyvindln commentedon Sep 17, 2017
15% is pretty significant.
jonas-schievink commentedon Sep 17, 2017
Wow, great work!
TimNN commentedon Sep 17, 2017
@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.
leoyvens commentedon Sep 17, 2017
I believe the PR should be targeted at https://github.com/rust-lang/llvm.
TimNN commentedon Sep 17, 2017
@leodasvacas: 👍
@andjo403: If you want to push through this patch the general process works like this:
rust-lang/llvm
(which isrust-llvm-release-4-0-1
at the moment)rust-lang/rust
which updates thesrc/llvm
submodule.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.
Mark-Simulacrum commentedon Sep 17, 2017
cc @arielb1
nagisa commentedon Sep 17, 2017
cc #33299
cuviper commentedon Sep 17, 2017
Ideally, the process should include discussion with upstream LLVM too.
andjo403 commentedon Sep 18, 2017
llvm ticket
7 remaining items