-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Discover better llvm optimizations for Rust #3519
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
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/ |
Indeed. Though I'd suggest blocking this on the two major codegen changes: removing refcounting and landing pads. |
As of right now, there are still enough changes in the pipe that this would probably be premature. |
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. |
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... |
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. |
"first" element check does nothing
…sion-of-nodejs, r=RalfJung bump actions/cache to v4 fixes rust-lang#3518.
…sion-of-nodejs, r=RalfJung bump actions/cache to v4 fixes rust-lang#3518.
Two observations:
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.
The text was updated successfully, but these errors were encountered: