-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Deprecate no-op codegen option -Cinline-threshold=...
#124712
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1485,7 +1485,8 @@ options! { | |
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED], | ||
"enable incremental compilation"), | ||
inline_threshold: Option<u32> = (None, parse_opt_number, [TRACKED], | ||
"set the threshold for inlining a function"), | ||
"this option is deprecated and does nothing \ | ||
(consider using `-Cllvm-args=--inline-threshold=...`)"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this have any effect if they do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that makes a difference. Building e.g. libstd with $ RUSTFLAGS="-Ccodegen-units=1 -Cllvm-args=--inline-threshold=100000" ./x build --stage 0 library/std
$ size ./build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/libstd.rlib
text ...
0 ...
1594437 ...
$ RUSTFLAGS="-Ccodegen-units=1 -Cllvm-args=--inline-threshold=2" ./x build --stage 0 library/std
$ size ./build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/libstd.rlib
text ...
0 ...
367682 ... Another example is bat with 33 MB vs 5.4 MB: $ RUSTFLAGS="-Cllvm-args=--inline-threshold=2" cargo build --release
$ ls -hl target/release/bat
-rwxr-xr-x 2 martin martin 5.4M May 5 10:58 target/release/bat
$ RUSTFLAGS="-Cllvm-args=--inline-threshold=100000" cargo build --release
$ ls -hl target/release/bat
-rwxr-xr-x 2 martin martin 33M May 5 11:13 target/release/bat There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh neat, I'm surprised it does anything! |
||
#[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")] | ||
instrument_coverage: InstrumentCoverage = (InstrumentCoverage::No, parse_instrument_coverage, [TRACKED], | ||
"instrument the generated code to support LLVM source-based code coverage reports \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//@ check-pass | ||
//@ compile-flags: -Cinline-threshold=666 | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
warning: the `-Cinline-threshold` flag is deprecated and does nothing (consider using `-Cllvm-args=--inline-threshold=...`) | ||
|
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.
TL;DR: If the deprecation ends up getting accepted (rather than the remapping), please emit a warning like
-Cno-stack-check
does (and unlike-Car=...
which we might want to change in a separate PR).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.
Done, including regression test.
Note that I also added this commit to this PR: