Add Liveness methods for updating live ranges.

The create_dead() methods can create a live range for a new value, and
extend_local() can extend a live range within an EBB where it is already
live.

This is enough to update liveness for new values as long as they stay
local to their EBB.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-07 10:39:47 -07:00
parent e47f4a49fb
commit 9adfd8709b
2 changed files with 50 additions and 1 deletions

View File

@@ -347,6 +347,14 @@ impl LiveRange {
self.def_begin
}
/// Move the definition of this value to a new program point.
///
/// It is only valid to move the definition within the same EBB, and it can't be moved beyond
/// `def_local_end()`.
pub fn move_def_locally(&mut self, def: ProgramPoint) {
self.def_begin = def;
}
/// Get the local end-point of this live range in the EBB where it is defined.
///
/// This can be the EBB header itself in the case of a dead EBB argument.