Skip to content

Commit c512a22

Browse files
committed
Auto merge of #131481 - nnethercote:rm-GenKillSet, r=cjgillot
Remove `GenKillAnalysis` There are two kinds of dataflow analysis in the compiler: `Analysis`, which is the basic kind, and `GenKillAnalysis`, which is a more specialized kind for gen/kill analyses that is intended as an optimization. However, it turns out that `GenKillAnalysis` is actually a pessimization! It's faster (and much simpler) to do all the gen/kill analyses via `Analysis`. This lets us remove `GenKillAnalysis`, and `GenKillSet`, and a few other things, and also merge `AnalysisDomain` into `Analysis`. The PR removes 500 lines of code and improves performance. r? `@tmiasko`
2 parents c16ba35 + 5a89436 commit c512a22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_utils/src/mir/possible_borrower.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'b, 'tcx> PossibleBorrowerMap<'b, 'tcx> {
213213
self.bitset.0.clear();
214214
let maybe_live = &mut self.maybe_live;
215215
if let Some(bitset) = self.map.get(&borrowed) {
216-
for b in bitset.iter().filter(move |b| maybe_live.contains(*b)) {
216+
for b in bitset.iter().filter(move |b| maybe_live.get().contains(*b)) {
217217
self.bitset.0.insert(b);
218218
}
219219
} else {
@@ -238,6 +238,6 @@ impl<'b, 'tcx> PossibleBorrowerMap<'b, 'tcx> {
238238

239239
pub fn local_is_alive_at(&mut self, local: mir::Local, at: mir::Location) -> bool {
240240
self.maybe_live.seek_after_primary_effect(at);
241-
self.maybe_live.contains(local)
241+
self.maybe_live.get().contains(local)
242242
}
243243
}

0 commit comments

Comments
 (0)