Trait cretonne_codegen::ir::ProgramOrder [−][src]
pub trait ProgramOrder { fn cmp<A, B>(&self, a: A, b: B) -> Ordering
where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>; fn is_ebb_gap(&self, inst: Inst, ebb: Ebb) -> bool; }
Context for ordering program points.
ProgramPoint
objects don't carry enough information to be ordered independently, they need a
context providing the program order.
Required Methods
fn cmp<A, B>(&self, a: A, b: B) -> Ordering where
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
Compare the program points a
and b
relative to this program order.
Return Less
if a
appears in the program before b
.
This is declared as a generic such that it can be called with Inst
and Ebb
arguments
directly. Depending on the implementation, there is a good chance performance will be
improved for those cases where the type of either argument is known statically.
fn is_ebb_gap(&self, inst: Inst, ebb: Ebb) -> bool
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
.
Implementors
impl ProgramOrder for Layout