Trait cranelift_codegen::ir::ProgramOrder
source · 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;
}Expand description
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§
sourcefn cmp<A, B>(&self, a: A, b: B) -> Orderingwhere
A: Into<ExpandedProgramPoint>,
B: Into<ExpandedProgramPoint>,
fn cmp<A, B>(&self, a: A, b: B) -> Orderingwhere
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.
sourcefn is_ebb_gap(&self, inst: Inst, ebb: Ebb) -> bool
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.