-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve documentation for codegen options #141554
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
Conversation
@@ -379,7 +396,7 @@ This flag controls the optimization level. | |||
* `2`: some optimizations. | |||
* `3`: all optimizations. | |||
* `s`: optimize for binary size. | |||
* `z`: optimize for binary size, but also turn off loop vectorization. | |||
* `z`: optimize for binary size, but more aggressively. Often results in larger binaries than `s` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the description from https://llvm.org/doxygen/classllvm_1_1OptimizationLevel.html#a1e916712888d6a2d3952834c126460e7
The fact that it's often worse is based on experience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd guess the old information was based on https://stackoverflow.com/questions/15548023/clang-optimization-levels
But that misses all the heuristics that are also affected by this flag, which are much more important (there's no way just not doing vectorization results in significantly bigger binaries)
3290111
to
d83495c
Compare
This comment has been minimized.
This comment has been minimized.
d83495c
to
2413eb4
Compare
This comment has been minimized.
This comment has been minimized.
2413eb4
to
71b39e5
Compare
71b39e5
to
8723cde
Compare
This comment has been minimized.
This comment has been minimized.
This adds more information to many different codegen options. It should not add any new guarantees, just document existing behavior.
8723cde
to
198e89b
Compare
@bors r+ rollup=always |
Rollup of 9 pull requests Successful merges: - #141554 (Improve documentation for codegen options) - #141817 (rustc_llvm: add Windows system libs only when cross-compiling from Wi…) - #141843 (Add `visit_id` to ast `Visitor`) - #141881 (Subtree update of `rust-analyzer`) - #141898 ([rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id) - #141921 (Disable f64 minimum/maximum tests for arm 32) - #141930 (Enable triagebot `[concern]` functionality) - #141936 (Decouple "reporting in deps" from `FutureIncompatibilityReason`) - #141949 (move `test-float-parse` tool into `src/tools` dir) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #141554 - Noratrieb:document-codegen-opts-better, r=bjorn3 Improve documentation for codegen options This adds more information to many different codegen options. It should not add any new guarantees, just document existing behavior. r? bjorn3
…ommend-over-recommended, r=lqd Fix incorrect use of "recommend" over "recommended" Spotted this typo in rust-lang#141554, but it has since been merged. r? `@Noratrieb`
This adds more information to many different codegen options. It should not add any new guarantees, just document existing behavior.
r? bjorn3