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 11, 2024
2 parents 3349155 + bedbc3c commit c0bcf54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 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,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let llfn = cx.get_fn(instance);

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

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

0 comments on commit c0bcf54

Please sign in to comment.