Bugfix: block start point is at start of block, not end.
This commit is contained in:
parent
9730254c41
commit
ae091d5319
|
@ -60,6 +60,8 @@ impl<'a> Context<'a> {
|
||||||
let mut live: HashMap<Value, usize> = HashMap::default();
|
let mut live: HashMap<Value, usize> = HashMap::default();
|
||||||
let mut block_starts: HashMap<Block, usize> = HashMap::default();
|
let mut block_starts: HashMap<Block, usize> = HashMap::default();
|
||||||
for &block in &self.cfg.postorder {
|
for &block in &self.cfg.postorder {
|
||||||
|
block_starts.insert(block, point);
|
||||||
|
|
||||||
self.body.blocks[block].terminator.visit_uses(|u| {
|
self.body.blocks[block].terminator.visit_uses(|u| {
|
||||||
self.handle_use(&mut live, &mut point, u);
|
self.handle_use(&mut live, &mut point, u);
|
||||||
});
|
});
|
||||||
|
@ -75,8 +77,6 @@ impl<'a> Context<'a> {
|
||||||
}
|
}
|
||||||
point += 1;
|
point += 1;
|
||||||
|
|
||||||
block_starts.insert(block, point);
|
|
||||||
|
|
||||||
// If there were any in-edges from blocks numbered earlier
|
// If there were any in-edges from blocks numbered earlier
|
||||||
// in postorder ("loop backedges"), extend the start of
|
// in postorder ("loop backedges"), extend the start of
|
||||||
// the backward-range on all live values at this point to
|
// the backward-range on all live values at this point to
|
||||||
|
|
Loading…
Reference in a new issue