Skip to content

Commit 6a22700

Browse files
committed
only benchmark borrowcking cyclic cfgs
1 parent ea6f7d7 commit 6a22700

File tree

1 file changed

+7
-9
lines changed
  • compiler/rustc_borrowck/src

1 file changed

+7
-9
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,13 @@ fn do_mir_borrowck<'tcx>(
610610
// }
611611

612612
if body.basic_blocks.thir_had_loops != Some(false) {
613-
// Cyclic
613+
// Cyclic: "single-pass"
614+
let borrows = Borrows::new(tcx, body, &regioncx, &borrow_set);
615+
let uninits = MaybeUninitializedPlaces::new(tcx, body, &move_data);
616+
let ever_inits = EverInitializedPlaces::new(body, &move_data);
617+
compute_cyclic_dataflow(body, borrows, uninits, ever_inits, &mut mbcx);
618+
} else {
619+
// Acyclic: default
614620
let (mut flow_analysis, flow_entry_states) =
615621
get_flow_results(tcx, body, &move_data, &borrow_set, &regioncx);
616622
visit_results(
@@ -620,13 +626,6 @@ fn do_mir_borrowck<'tcx>(
620626
&flow_entry_states,
621627
&mut mbcx,
622628
);
623-
} else {
624-
// Acyclic
625-
let borrows = Borrows::new(tcx, body, &regioncx, &borrow_set);
626-
let uninits = MaybeUninitializedPlaces::new(tcx, body, &move_data);
627-
let ever_inits = EverInitializedPlaces::new(body, &move_data);
628-
let mut analysis = Borrowck { borrows, uninits, ever_inits };
629-
compute_rpo_dataflow(body, &mut analysis, &mut mbcx);
630629
}
631630

632631
// if body.basic_blocks.thir_had_loops.unwrap_or_else(|| body.basic_blocks.is_cfg_cyclic()) {
@@ -2552,7 +2551,6 @@ fn do_mir_borrowck<'tcx>(
25522551
result
25532552
}
25542553

2555-
#[cfg(test)]
25562554
fn compute_cyclic_dataflow<'mir, 'tcx>(
25572555
body: &Body<'tcx>,
25582556
borrows: Borrows<'mir, 'tcx>,

0 commit comments

Comments
 (0)