Skip to content

Commit 6005c92

Browse files
committed
Auto merge of #112294 - saethlin:inline-me-maybe, r=oli-obk
Ignore the always part of #[inline(always)] in MIR inlining `#[inline(always)]` is used in two cases: for functions that are so trivial it is always profitable to inline them, but also for functions which LLVM thinks are a bad inlining candidate, but which actually turn out to be profitable to inline. That second justification doesn't apply to the MIR inliner, so ignoring our cost estimation for these functions is not necessarily the right right thing to do. This is basically a wash on non-check runs and a perf benefit in check runs. There are some notable regressions, and I think we might be able to claw those back by turning `#[inline(always)]` into a stronger hint. But I think this PR stands decently on its own as a tidy simplification.
2 parents 9cfa528 + afb83f8 commit 6005c92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/fail/terminate-terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@compile-flags: -Zmir-opt-level=3
1+
//@compile-flags: -Zmir-opt-level=3 -Zinline-mir-hint-threshold=1000
22
// Enable MIR inlining to ensure that `TerminatorKind::Terminate` is generated
33
// instead of just `UnwindAction::Terminate`.
44

0 commit comments

Comments
 (0)