Skip to content

Commit 1ab17c0

Browse files
Auto merge of #143334 - Stypox:layout_of-inline, r=<try>
Always inline InterpCx::layout_of after perf regression Followup to #142721 to fix the performance regression. I ran one quick benchmark locally (`ctfe-stress-5`) and it does seem to be faster. I further tried adding `#[inline(always)]` to `compiler/rustc_middle/src/ty/layout.rs` in `layout_of()` under `LayoutOfHelpers` but that didn't change the benchmark results at all. `@rust-timer` build e7e3c9e (I'm not sure I have permission to do the above) r? `@RalfJung` <!-- homu-ignore:start --> <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> <!-- homu-ignore:end -->
2 parents b94bd12 + e7e3c9e commit 1ab17c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/eval_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
9696
/// This inherent method takes priority over the trait method with the same name in LayoutOf,
9797
/// and allows wrapping the actual [LayoutOf::layout_of] with a tracing span.
9898
/// See [LayoutOf::layout_of] for the original documentation.
99-
#[inline]
99+
#[inline(always)]
100100
pub fn layout_of(
101101
&self,
102102
ty: Ty<'tcx>,

0 commit comments

Comments
 (0)