interpret: mark some hot functions inline(always)

recovers some of the perf regressions from #129778
This commit is contained in:
Ralf Jung 2024-09-10 15:54:47 +02:00
parent 26b2b8d162
commit d104dedad9
2 changed files with 5 additions and 0 deletions

View File

@ -433,6 +433,7 @@ impl<'tcx, Prov: Provenance> Projectable<'tcx, Prov> for ImmTy<'tcx, Prov> {
Ok(self.offset_(offset, layout, ecx)) Ok(self.offset_(offset, layout, ecx))
} }
#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>( fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self, &self,
_ecx: &InterpCx<'tcx, M>, _ecx: &InterpCx<'tcx, M>,
@ -522,6 +523,7 @@ impl<'tcx, Prov: Provenance> Projectable<'tcx, Prov> for OpTy<'tcx, Prov> {
} }
} }
#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>( fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self, &self,
_ecx: &InterpCx<'tcx, M>, _ecx: &InterpCx<'tcx, M>,

View File

@ -166,6 +166,7 @@ impl<'tcx, Prov: Provenance> Projectable<'tcx, Prov> for MPlaceTy<'tcx, Prov> {
Ok(MPlaceTy { mplace: self.mplace.offset_with_meta_(offset, mode, meta, ecx)?, layout }) Ok(MPlaceTy { mplace: self.mplace.offset_with_meta_(offset, mode, meta, ecx)?, layout })
} }
#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>( fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self, &self,
_ecx: &InterpCx<'tcx, M>, _ecx: &InterpCx<'tcx, M>,
@ -299,6 +300,7 @@ impl<'tcx, Prov: Provenance> Projectable<'tcx, Prov> for PlaceTy<'tcx, Prov> {
}) })
} }
#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>( fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self, &self,
ecx: &InterpCx<'tcx, M>, ecx: &InterpCx<'tcx, M>,
@ -560,6 +562,7 @@ where
/// Given a place, returns either the underlying mplace or a reference to where the value of /// Given a place, returns either the underlying mplace or a reference to where the value of
/// this place is stored. /// this place is stored.
#[inline(always)]
fn as_mplace_or_mutable_local( fn as_mplace_or_mutable_local(
&mut self, &mut self,
place: &PlaceTy<'tcx, M::Provenance>, place: &PlaceTy<'tcx, M::Provenance>,