Skip to content

Commit

Permalink
Auto merge of rust-lang#130197 - RalfJung:interp-perf, r=saethlin
Browse files Browse the repository at this point in the history
interpret: mark some hot functions inline(always)

That seems to recover a good part of the perf impact of rust-lang#129778.

r? `@saethlin`
  • Loading branch information
bors committed Sep 11, 2024
2 parents f7f8bdf + d104ded commit 5bce6d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_const_eval/src/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ impl<'tcx, Prov: Provenance> Projectable<'tcx, Prov> for ImmTy<'tcx, Prov> {
Ok(self.offset_(offset, layout, ecx))
}

#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self,
_ecx: &InterpCx<'tcx, M>,
Expand Down Expand Up @@ -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>>(
&self,
_ecx: &InterpCx<'tcx, M>,
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_const_eval/src/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

#[inline(always)]
fn to_op<M: Machine<'tcx, Provenance = Prov>>(
&self,
_ecx: &InterpCx<'tcx, M>,
Expand Down Expand Up @@ -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>>(
&self,
ecx: &InterpCx<'tcx, M>,
Expand Down Expand Up @@ -560,6 +562,7 @@ where

/// 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>,
Expand Down

0 comments on commit 5bce6d4

Please sign in to comment.