Closed
Description
Two observations:
- Running llvm optimizations is the greater part of rustc's time, so we should take care not to run ineffective optimizations.
- Rust code has its own unique character so what are good llvm defaults may not be the best Rust defaults
Let us find the ideal combination of passes that is both fast to compile and creates fast code. LLVM almost certainly has tools for this. Testing should be done with split stacks disabled.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
lomereiter commentedon Dec 25, 2012
You may be interested in this blogpost about using Acovea for finding near-optimal flags using genetic algorithm: http://donsbot.wordpress.com/2010/03/01/evolving-faster-haskell-programs-now-with-llvm/
graydon commentedon Dec 26, 2012
Indeed. Though I'd suggest blocking this on the two major codegen changes: removing refcounting and landing pads.
bstrie commentedon Apr 29, 2013
As of right now, there are still enough changes in the pipe that this would probably be premature.
thestinger commentedon May 25, 2013
The reason the LLVM passes take so long is because we're generating really poor pre-optimization IR. For a simple swap function, we output 150+ lines of IR while clang only has 10-15 instructions at -O0.
I think we'll need to fix the major issues with our code generation before tackling this.
Aatch commentedon May 29, 2013
For some real numbers as to our code gen quality. We spend ~20% of the LLVM passes on combining redundant instructions.
Now this might be just be a quirk of the pipeline, but it doesn't seem right to me...
thestinger commentedon Jul 4, 2013
I redid the LLVM optimization passes to match the passes used in clang 3.3 and I don't think we can do any better because we don't have different needs or patterns than C++11. The reason our compilation is many times slower than clang's is because we generate 50-200x as much IR from our poor codegen.
Merge pull request rust-lang#3519 from oli-obk/patch-1
Auto merge of rust-lang#3519 - hamirmahal:fix/usage-of-deprecated-ver…
Auto merge of rust-lang#3519 - hamirmahal:fix/usage-of-deprecated-ver…