Never inline cold functions
The information about cold attribute is lost during inlining, Avoid the issue by never inlining cold functions.
This commit is contained in:
parent
0b4af1614d
commit
ae4332643d
1 changed files with 2 additions and 2 deletions
|
@ -252,9 +252,9 @@ impl Inliner<'tcx> {
|
|||
self.tcx.sess.opts.debugging_opts.inline_mir_threshold
|
||||
};
|
||||
|
||||
// Significantly lower the threshold for inlining cold functions
|
||||
if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::COLD) {
|
||||
threshold /= 5;
|
||||
debug!("#[cold] present - not inlining");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Give a bonus functions with a small number of blocks,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue