8 files changed +17
-22
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 @@ -120,7 +120,6 @@ pub struct ModuleConfig {
120
120
pub vectorize_loop : bool ,
121
121
pub vectorize_slp : bool ,
122
122
pub merge_functions : bool ,
123
- pub inline_threshold : Option < u32 > ,
124
123
pub emit_lifetime_markers : bool ,
125
124
pub llvm_plugins : Vec < String > ,
126
125
}
@@ -280,7 +279,6 @@ impl ModuleConfig {
280
279
}
281
280
} ,
282
281
283
- inline_threshold : sess. opts . cg . inline_threshold ,
284
282
emit_lifetime_markers : sess. emit_lifetime_markers ( ) ,
285
283
llvm_plugins : if_regular ! ( sess. opts. unstable_opts. llvm_plugins. clone( ) , vec![ ] ) ,
286
284
}
Original file line number Diff line number Diff line change @@ -1133,7 +1133,11 @@ pub fn describe_flag_categories(early_dcx: &EarlyDiagCtxt, matches: &Matches) ->
1133
1133
}
1134
1134
1135
1135
if cg_flags. iter( ) . any( |x| * x == "no-stack-check" ) {
1136
- early_dcx. early_warn( "the --no-stack-check flag is deprecated and does nothing" ) ;
1136
+ early_dcx. early_warn( "the `-Cno-stack-check` flag is deprecated and does nothing" ) ;
1137
+ }
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=...`)" ) ;
1137
1141
}
1138
1142
1139
1143
if cg_flags. iter( ) . any( |x| * x == "passes=list" ) {
Original file line number Diff line number Diff line change @@ -1499,7 +1499,8 @@ options! {
1499
1499
incremental: Option <String > = ( None , parse_opt_string, [ UNTRACKED ] ,
1500
1500
"enable incremental compilation" ) ,
1501
1501
inline_threshold: Option <u32 > = ( None , parse_opt_number, [ TRACKED ] ,
1502
- "set the threshold for inlining a function" ) ,
1502
+ "this option is deprecated and does nothing \
1503
+ (consider using `-Cllvm-args=--inline-threshold=...`)") ,
1503
1504
#[ rustc_lint_opt_deny_field_access( "use `Session::instrument_coverage` instead of this field" ) ]
1504
1505
instrument_coverage: InstrumentCoverage = ( InstrumentCoverage :: No , parse_instrument_coverage, [ TRACKED ] ,
1505
1506
"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