Skip to content

Commit

Permalink
Auto merge of #125025 - saethlin:clone-your-body, r=<try>
Browse files Browse the repository at this point in the history
[perf experiments] Clone all MIR bodies

We keep saying things like cloning all the MIR would be expensive, but... how expensive actually?
  • Loading branch information
bors committed May 12, 2024
2 parents 8b64adc + 940cb4a commit f0a6c88
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_codegen_ssa/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let llfn = cx.get_fn(instance);

let mir = cx.tcx().instance_mir(instance.def);
let body: rustc_middle::mir::Body<'tcx> = mir.clone();
drop(std::hint::black_box(body));

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

0 comments on commit f0a6c88

Please sign in to comment.