Auto merge of #130197 - RalfJung:interp-perf, r=saethlin

interpret: mark some hot functions inline(always)

That seems to recover a good part of the perf impact of https://github.com/rust-lang/rust/pull/129778.

r? `@saethlin`
This commit is contained in:
bors 2024-09-11 17:02:40 +00:00
commit 5bce6d48ff
2 changed files with 5 additions and 0 deletions

View File

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

View File

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