Skip to content

Commit

Permalink
Auto merge of rust-lang#130197 - RalfJung:interp-perf, r=<try>
Browse files Browse the repository at this point in the history
experiment: see where the perf regressions in rust-lang#129778 come from

Let's see if we can figure out what caused the perf impact in rust-lang#129778.

There are some extra functions in a few places so maybe more `inline(always)` helps...

r? `@saethlin`
  • Loading branch information
bors committed Sep 10, 2024
2 parents f827364 + 0852bf2 commit a775fd6
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 a775fd6

Please sign in to comment.