Uh oh!
There was an error while loading. Please reload this page.
Improve documentation for codegen options - #141554
Conversation
| * `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.
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.
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)
Uh oh!
There was an error while loading. Please reload this page.
3290111 to
d83495cCompare
This comment has been minimized.
This comment has been minimized.
d83495c to
2413eb4Compare
This comment has been minimized.
This comment has been minimized.
2413eb4 to
71b39e5CompareUh oh!
There was an error while loading. Please reload this page.
71b39e5 to
8723cdeCompare
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
198e89bComparebjorn3
commented
Jun 3, 2025
@bors r+ rollup=always |
bors
commented
Jun 3, 2025
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`
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141554 (Improve documentation for codegen options) - rust-lang/rust#141817 (rustc_llvm: add Windows system libs only when cross-compiling from Wi…) - rust-lang/rust#141843 (Add `visit_id` to ast `Visitor`) - rust-lang/rust#141881 (Subtree update of `rust-analyzer`) - rust-lang/rust#141898 ([rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id) - rust-lang/rust#141921 (Disable f64 minimum/maximum tests for arm 32) - rust-lang/rust#141930 (Enable triagebot `[concern]` functionality) - rust-lang/rust#141936 (Decouple "reporting in deps" from `FutureIncompatibilityReason`) - rust-lang/rust#141949 (move `test-float-parse` tool into `src/tools` dir) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#141554 (Improve documentation for codegen options) - rust-lang#141817 (rustc_llvm: add Windows system libs only when cross-compiling from Wi…) - rust-lang#141843 (Add `visit_id` to ast `Visitor`) - rust-lang#141881 (Subtree update of `rust-analyzer`) - rust-lang#141898 ([rustdoc-json] Implement PartialOrd and Ord for rustdoc_types::Id) - rust-lang#141921 (Disable f64 minimum/maximum tests for arm 32) - rust-lang#141930 (Enable triagebot `[concern]` functionality) - rust-lang#141936 (Decouple "reporting in deps" from `FutureIncompatibilityReason`) - rust-lang#141949 (move `test-float-parse` tool into `src/tools` dir) r? `@ghost` `@rustbot` modify labels: rollup
This adds more information to many different codegen options. It should not add any new guarantees, just document existing behavior.
r? bjorn3