about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_mir_transform/src/dest_prop.rs18
1 files changed, 4 insertions, 14 deletions
diff --git a/compiler/rustc_mir_transform/src/dest_prop.rs b/compiler/rustc_mir_transform/src/dest_prop.rs
index f7057b0a6ab..f5f496acfce 100644
--- a/compiler/rustc_mir_transform/src/dest_prop.rs
+++ b/compiler/rustc_mir_transform/src/dest_prop.rs
@@ -164,7 +164,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
 
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
         let def_id = body.source.def_id();
-        let mut allocations = Allocations::default();
+        let mut candidates = FxIndexMap::default();
+        let mut candidates_reverse = FxIndexMap::default();
         let mut write_info = WriteInfo::default();
         trace!(func = ?tcx.def_path_str(def_id));
 
@@ -196,8 +197,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
             let mut candidates = find_candidates(
                 body,
                 &borrowed,
-                &mut allocations.candidates,
-                &mut allocations.candidates_reverse,
+                &mut candidates,
+                &mut candidates_reverse,
             );
             trace!(?candidates);
             dest_prop_mir_dump(tcx, body, &points, &live, round_count);
@@ -255,17 +256,6 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
     }
 }
 
-/// Container for the various allocations that we need.
-///
-/// We store these here and hand out `&mut` access to them, instead of dropping and recreating them
-/// frequently. Everything with a `&'alloc` lifetime points into here.
-#[derive(Default)]
-struct Allocations {
-    candidates: FxIndexMap<Local, Vec<Local>>,
-    candidates_reverse: FxIndexMap<Local, Vec<Local>>,
-    // PERF: Do this for `MaybeLiveLocals` allocations too.
-}
-
 #[derive(Debug)]
 struct Candidates<'alloc> {
     /// The set of candidates we are considering in this optimization.