Coalesce live range intervals in adjacent EBBs

LiveRanges represent the live-in range of a value as a sorted
list of intervals. Each interval starts at an EBB and continues
to an instruction. Before this commit, the LiveRange would store
an interval for each EBB. This commit changes the representation
such that intervals continuing from one EBB to another are coalesced
into one.

Fixes #37.
This commit is contained in:
Mikko Perttunen
2017-02-14 14:04:03 +02:00
committed by Jakob Stoklund Olesen
parent f6391c57e8
commit 5a1d9561a7
3 changed files with 115 additions and 11 deletions

View File

@@ -94,6 +94,11 @@ pub trait ProgramOrder {
fn cmp<A, B>(&self, a: A, b: B) -> cmp::Ordering
where A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>;
/// Is the range from `inst` to `ebb` just the gap between consecutive EBBs?
///
/// This returns true if `inst` is the terminator in the EBB immediately before `ebb`.
fn is_ebb_gap(&self, inst: Inst, ebb: Ebb) -> bool;
}
#[cfg(test)]