Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb183e2
Distinct CFG type for MIR, traversals to librustc
nagisa May 14, 2016
d7a0466
Impl a generic lattice-based DF framework
nagisa May 14, 2016
060d840
Implement a ACS propagation pass
nagisa May 14, 2016
e20d181
Remove use of specialization in Lattice to avoid use of unstable feat…
gereeter May 16, 2016
ea689a0
Remove DataflowPass
gereeter May 16, 2016
c1bb060
Add &self arguments to Transfer and Rewrite and start taking them by …
gereeter May 16, 2016
52eff47
Remove unused and buggy support for dataflow passes that introduce mu…
gereeter May 16, 2016
6413fe6
Let ar_forward generate its own queue
gereeter May 16, 2016
0756739
Change the fully capitalized ACS to the partially capitalized Acs, ma…
gereeter May 16, 2016
a0eebd3
Fix various nits in MIR Dataflow
gereeter May 22, 2016
7cbcb4b
Actually rewrite constants in AcsPropagate
gereeter May 22, 2016
4af1473
Remove some unnecessary `pub`s in AcsPropagate
gereeter May 25, 2016
ad37533
Invalidate values in AcsLattice that are overwritten, either by a wri…
gereeter May 25, 2016
9b3ecda
Temporarily completely disable Backward dataflow to fix unused varian…
gereeter May 25, 2016
b0fbbae
Rewrite AcsLattice to be more correct
gereeter May 27, 2016
7f1d4c8
Further correctness improvements to AcsRewrite
gereeter May 31, 2016
cfcf7cd
Remove unused import left over from rebase
gereeter Jun 7, 2016
ae0c91c
Properly reset basic blocks optimized based on overspeculative inform…
gereeter Jun 8, 2016
ffc2406
Implement MIR's CFG::swap correctly
gereeter Jun 8, 2016
3bd906c
Mutably update blocks when analyzing instead of creating new ones. ru…
gereeter Jun 8, 2016
07d073e
Fix make tidy
gereeter Jun 8, 2016
282d51d
Also clear the Acs cache on DropAndReplace
gereeter Jun 8, 2016
f4452c8
Use the generic WBottom for AcsLattice
gereeter Jun 8, 2016
c045fa4
Properly implement intersection in AcsLattice::join
gereeter Jun 9, 2016
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
Properly reset basic blocks optimized based on overspeculative inform…
…ation
  • Loading branch information
gereeter committed Jun 8, 2016
commit ae0c91c59d586ca319c46e95d05de0cef76d8b18
16 changes: 11 additions & 5 deletions src/librustc/mir/transform/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ enum Direction {
/// The fixpoint function is the engine of this whole thing. Important part of it is the `f: BF`
/// callback. This for each basic block and its facts has to produce a replacement graph and a
/// bunch of facts which are to be joined with the facts in the graph elsewhere.
fn fixpoint<'tcx, F: Lattice, BF>(cfg: &CFG<'tcx>,
fn fixpoint<'tcx, F: Lattice, BF>(original_cfg: &CFG<'tcx>,
direction: Direction,
f: BF,
to_visit: &mut BitVector,
Expand All @@ -332,7 +332,7 @@ where BF: Fn(BasicBlock, &F, &mut CFG<'tcx>) -> (Option<BasicBlock>, Vec<F>),
// Invariant:
// * None of the already existing blocks in CFG may be modified;
{
let mut cfg = cfg.clone();
let mut cfg = original_cfg.clone();

while let Some(block) = to_visit.iter().next() {
to_visit.remove(block);
Expand All @@ -351,13 +351,19 @@ where BF: Fn(BasicBlock, &F, &mut CFG<'tcx>) -> (Option<BasicBlock>, Vec<F>),
// Then we record the facts in the correct direction.
match direction {
Direction::Forward => {
let mut changed_targets = vec![];

for (f, &target) in new_facts.into_iter()
.zip(cfg[block].terminator().successors().iter()) {
let facts_changed = Lattice::join(&mut init_facts[target], &f);
if facts_changed {
to_visit.insert(target.index());
if Lattice::join(&mut init_facts[target], &f) {
changed_targets.push(target);
}
}

for target in changed_targets {
to_visit.insert(target.index());
cfg[target].clone_from(&original_cfg[target]);
}
}
// Direction::Backward => unimplemented!()
// let mut new_facts = new_facts;
Expand Down