about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-09-10 15:54:47 +0200
committerRalf Jung <post@ralfj.de>2024-09-10 22:43:56 +0200
commitd104dedad97c935aa328c9b3ebdc6ce6a68414ad (patch)
tree8fc8fb21db9922757ff93f09dc2fc311d7f7f02a /compiler/rustc_const_eval/src
parent26b2b8d162ff6cc399c7e8005230beea7eb12037 (diff)
downloadrust-d104dedad97c935aa328c9b3ebdc6ce6a68414ad.tar.gz
rust-d104dedad97c935aa328c9b3ebdc6ce6a68414ad.zip
interpret: mark some hot functions inline(always)
recovers some of the perf regressions from #129778
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs2
-rw-r--r--compiler/rustc_const_eval/src/interpret/place.rs3
2 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index b906e3422db..bb7e58b83ac 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -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>,
@@ -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>,
diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs
index 3b14142da02..1eca92812df 100644
--- a/compiler/rustc_const_eval/src/interpret/place.rs
+++ b/compiler/rustc_const_eval/src/interpret/place.rs
@@ -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>,
@@ -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>,
@@ -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>,