Skip to content

Commit c0bcf54

Browse files
committed
Auto merge of #125025 - saethlin:clone-your-body, r=<try>
[perf experiments] Clone all MIR bodies We keep saying things like cloning all the MIR would be expensive, but... how expensive actually?
2 parents 3349155 + bedbc3c commit c0bcf54

File tree

1 file changed

+1
-0
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+1
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
166166
let llfn = cx.get_fn(instance);
167167

168168
let mir = cx.tcx().instance_mir(instance.def);
169+
drop(std::hint::black_box(mir.clone()));
169170

170171
let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
171172
debug!("fn_abi: {:?}", fn_abi);

0 commit comments

Comments
 (0)