Skip to content

Commit ca8078d

Browse files
committed
Auto merge of #89495 - Mark-Simulacrum:add-inlines, r=michaelwoerister
Add two inline annotations for hot functions These two functions are essentially no-ops (and compile to just a load and return), but show up in process_obligations profiles with a high call count -- so worthwhile to try and inline them. This is not normally possible as they're non-generic, so they don't get offered for inlining by our current algorithm.
2 parents d3e6770 + 1c2ad79 commit ca8078d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compiler/rustc_infer/src/infer/type_variable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ pub(crate) struct TyVidEqKey<'tcx> {
400400
}
401401

402402
impl<'tcx> From<ty::TyVid> for TyVidEqKey<'tcx> {
403+
#[inline] // make this function eligible for inlining - it is quite hot.
403404
fn from(vid: ty::TyVid) -> Self {
404405
TyVidEqKey { vid, phantom: PhantomData }
405406
}

compiler/rustc_type_ir/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ impl EqUnifyValue for IntVarValue {}
437437

438438
impl UnifyKey for IntVid {
439439
type Value = Option<IntVarValue>;
440+
#[inline] // make this function eligible for inlining - it is quite hot.
440441
fn index(&self) -> u32 {
441442
self.index
442443
}

0 commit comments

Comments
 (0)