7 files changed +16
-19
lines changed Original file line number Diff line number Diff line change @@ -564,9 +564,6 @@ pub(crate) unsafe fn llvm_optimize(
564
564
565
565
let llvm_plugins = config. llvm_plugins . join ( "," ) ;
566
566
567
- // FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
568
- // We would have to add upstream support for this first, before we can support
569
- // config.inline_threshold and our more aggressive default thresholds.
570
567
let result = llvm:: LLVMRustOptimize (
571
568
module. module_llvm . llmod ( ) ,
572
569
& * module. module_llvm . tm ,
Original file line number Diff line number Diff line change @@ -1136,6 +1136,10 @@ pub fn describe_flag_categories(early_dcx: &EarlyDiagCtxt, matches: &Matches) ->
1136
1136
early_dcx. early_warn( "the `-Cno-stack-check` flag is deprecated and does nothing" ) ;
1137
1137
}
1138
1138
1139
+ if cg_flags. iter( ) . any( |x| x. starts_with( "inline-threshold" ) ) {
1140
+ early_dcx. early_warn( "the `-Cinline-threshold` flag is deprecated and does nothing (consider using `-Cllvm-args=--inline-threshold=...`)" ) ;
1141
+ }
1142
+
1139
1143
if cg_flags. iter( ) . any( |x| * x == "passes=list" ) {
1140
1144
let backend_name = debug_flags. iter( ) . find_map( |x| x. strip_prefix( "codegen-backend=" ) ) ;
1141
1145
Original file line number Diff line number Diff line change @@ -1485,7 +1485,8 @@ options! {
1485
1485
incremental: Option <String > = ( None , parse_opt_string, [ UNTRACKED ] ,
1486
1486
"enable incremental compilation" ) ,
1487
1487
inline_threshold: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
1488
- "set the threshold for inlining a function" ) ,
1488
+ "this option is deprecated and does nothing \
1489
+ (consider using `-Cllvm-args=--inline-threshold=...`)") ,
1489
1490
#[ rustc_lint_opt_deny_field_access( "use `Session::instrument_coverage` instead of this field" ) ]
1490
1491
instrument_coverage: InstrumentCoverage = ( InstrumentCoverage :: No , parse_instrument_coverage, [ TRACKED ] ,
1491
1492
"instrument the generated code to support LLVM source-based code coverage reports \
Original file line number Diff line number Diff line change @@ -184,20 +184,9 @@ incremental files will be stored.
184
184
185
185
## inline-threshold
186
186
187
- This option lets you set the default threshold for inlining a function. It
188
- takes an unsigned integer as a value. Inlining is based on a cost model, where
189
- a higher threshold will allow more inlining.
190
-
191
- The default depends on the [ opt-level] ( #opt-level ) :
192
-
193
- | opt-level | Threshold |
194
- | -----------| -----------|
195
- | 0 | N/A, only inlines always-inline functions |
196
- | 1 | N/A, only inlines always-inline functions and LLVM lifetime intrinsics |
197
- | 2 | 225 |
198
- | 3 | 275 |
199
- | s | 75 |
200
- | z | 25 |
187
+ This option is deprecated and does nothing.
188
+
189
+ Consider using ` -Cllvm-args=--inline-threshold=... ` .
201
190
202
191
## instrument-coverage
203
192
Original file line number Diff line number Diff line change 1
1
//@ run-pass
2
- //@ compile-flags: -Ccodegen-units=1 -Cinline -threshold=0 -Clink-dead-code -Copt-level=0 -Cdebuginfo=2
2
+ //@ compile-flags: -Ccodegen-units=1 -Cllvm-args=--inline -threshold=0 -Clink-dead-code -Copt-level=0 -Cdebuginfo=2
3
3
4
4
// Make sure LLVM does not miscompile this.
5
5
Original file line number Diff line number Diff line change
1
+ //@ check-pass
2
+ //@ compile-flags: -Cinline-threshold=666
3
+
4
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: the `-Cinline-threshold` flag is deprecated and does nothing (consider using `-Cllvm-args=--inline-threshold=...`)
2
+
0 commit comments