Skip to content

Commit

Permalink
Rollup merge of #133163 - RalfJung:cold, r=saethlin
Browse files Browse the repository at this point in the history
remove pointless cold_path impl in interpreter

This has a fallback impl so the interpreter impl is not needed.

r? ``@saethlin``
  • Loading branch information
GuillaumeGomez authored Nov 18, 2024
2 parents 86ba13b + dff98a8 commit 4baf540
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ fn codegen_regular_intrinsic_call<'tcx>(

sym::cold_path => {
// This is a no-op. The intrinsic is just a hint to the optimizer.
// We still have an impl here to avoid it being turned into a call.
}

// Unimplemented intrinsics must have a fallback body. The fallback body is obtained
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// These just return their argument
self.copy_op(&args[0], dest)?;
}
sym::cold_path => {
// This is a no-op. The intrinsic is just a hint to the optimizer.
}
sym::raw_eq => {
let result = self.raw_eq_intrinsic(&args[0], &args[1])?;
self.write_scalar(result, dest)?;
Expand Down

0 comments on commit 4baf540

Please sign in to comment.