1
Fork 0

Use optional values for inlining thresholds

Turn inlining threshold into optional values to make it possible to
configure different defaults depending on the current mir-opt-level.
This commit is contained in:
Tomasz Miąsko 2021-02-21 00:00:00 +00:00
parent f895f1c35a
commit 500aeccc5b
3 changed files with 6 additions and 6 deletions

View file

@ -349,9 +349,9 @@ impl Inliner<'tcx> {
let tcx = self.tcx;
let mut threshold = if callee_attrs.requests_inline() {
self.tcx.sess.opts.debugging_opts.inline_mir_hint_threshold
self.tcx.sess.opts.debugging_opts.inline_mir_hint_threshold.unwrap_or(100)
} else {
self.tcx.sess.opts.debugging_opts.inline_mir_threshold
self.tcx.sess.opts.debugging_opts.inline_mir_threshold.unwrap_or(50)
};
// Give a bonus functions with a small number of blocks,