@@ -164,7 +164,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
164
164
165
165
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
166
166
let def_id = body.source.def_id();
167
- let mut allocations = Allocations::default();
167
+ let mut candidates = FxIndexMap::default();
168
+ let mut candidates_reverse = FxIndexMap::default();
168
169
let mut write_info = WriteInfo::default();
169
170
trace!(func = ?tcx.def_path_str(def_id));
170
171
@@ -196,8 +197,8 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
196
197
let mut candidates = find_candidates(
197
198
body,
198
199
&borrowed,
199
- &mut allocations. candidates,
200
- &mut allocations. candidates_reverse,
200
+ &mut candidates,
201
+ &mut candidates_reverse,
201
202
);
202
203
trace!(?candidates);
203
204
dest_prop_mir_dump(tcx, body, &points, &live, round_count);
@@ -255,17 +256,6 @@ impl<'tcx> MirPass<'tcx> for DestinationPropagation {
255
256
}
256
257
}
257
258
258
- /// Container for the various allocations that we need.
259
- ///
260
- /// We store these here and hand out `&mut` access to them, instead of dropping and recreating them
261
- /// frequently. Everything with a `&'alloc` lifetime points into here.
262
- #[derive(Default)]
263
- struct Allocations {
264
- candidates: FxIndexMap<Local, Vec<Local>>,
265
- candidates_reverse: FxIndexMap<Local, Vec<Local>>,
266
- // PERF: Do this for `MaybeLiveLocals` allocations too.
267
- }
268
-
269
259
#[derive(Debug)]
270
260
struct Candidates<'alloc> {
271
261
/// The set of candidates we are considering in this optimization.
0 commit comments