Skip to content

Commit f0a6c88

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 8b64adc + 940cb4a commit f0a6c88

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ 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+
let body: rustc_middle::mir::Body<'tcx> = mir.clone();
170+
drop(std::hint::black_box(body));
169171

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

0 commit comments

Comments
 (0)