Skip to content

perf: Only process changed obligations in ObligationForest #69218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
85bbd7d
perf: Avoid allocating a new Vec on each stall
Feb 1, 2020
4cf514a
perf: Only process changed obligations in ObligationForest
Feb 3, 2020
64b2bbd
perf: Avoid logging unifications that ObligationForest do not watch
Feb 17, 2020
bb70251
refactor: Prefer copy_from_slice instead of explicit loop
Feb 17, 2020
65014d8
Optimize ModifiedSet for faster snapshot/rollback
Feb 17, 2020
6eeea05
refactor: Make UnifyLog have lower overhead snapshots
Feb 18, 2020
aa4595a
perf: No need to track modified variables in a bitset
Feb 19, 2020
31fb673
Start reading where ModifiedSet currently is
Feb 19, 2020
cd86ce1
Rebase on top of undo_log unification
Apr 11, 2020
0f08a69
Clear the modified set once no snapshots exist
Apr 11, 2020
f5dbb04
Document the additions
May 4, 2020
22abfb6
refactor: Simplify obligation_forest
May 30, 2020
f771696
perf: No need to resolve variables in fulfillment
Jun 5, 2020
34f3303
Document obligation forest changes
Jun 6, 2020
795c810
Restore clearing of stalled_on before process_obligation
Jun 6, 2020
4dcb973
fix: Avoid dropping and re-registering offsets in the obligation forest
Marwes Jul 18, 2020
c49182b
Ensure that predicates that change are marked as done
Marwes Aug 9, 2020
8e6ca04
Restore alternative predicates for obligation forest
Marwes Aug 11, 2020
dee0521
Fix rebase
Sep 27, 2020
a5c4370
test
Oct 16, 2020
cca4b12
a
Oct 16, 2020
929b4a9
a
Oct 18, 2020
22c5b94
a
Oct 26, 2020
d3d3fc4
Always use the simple obligation forest
Oct 26, 2020
b27911a
Hack out unify log for perf
Oct 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
a
  • Loading branch information
Markus Westerlind committed Oct 26, 2020
commit 929b4a96a0dda2aab9b92953713ad7e5f8d166c7
10 changes: 8 additions & 2 deletions compiler/rustc_data_structures/src/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ impl<O: ForestObligation> ObligationForest<O> {
// `for index in 0..self.nodes.len() { ... }` because the range would
// be computed with the initial length, and we would miss the appended
// nodes. Therefore we use a `while` loop.
let mut completed = vec![];
loop {
let mut i = 0;
let mut made_progress_this_iteration = false;
Expand Down Expand Up @@ -826,10 +827,15 @@ impl<O: ForestObligation> ObligationForest<O> {

self.mark_successes();
self.process_cycles(processor);
self.compress(do_completed);
if let Some(mut c) = self.compress(do_completed) {
completed.append(&mut c);
}
}

Some(Outcome { completed: None, errors })
Some(Outcome {
completed: if do_completed == DoCompleted::Yes { Some(completed) } else { None },
errors,
})
}

/// Checks which nodes have been unblocked since the last time this was called. All nodes that
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_data_structures/src/obligation_forest/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ where
type Obligation = O;
type Error = E;

fn checked_process_obligation(
&mut self,
obligation: &mut Self::Obligation,
) -> ProcessResult<Self::Obligation, Self::Error> {
(self.process_obligation)(obligation)
}

fn process_obligation(
&mut self,
obligation: &mut Self::Obligation,
Expand Down