Generalize rpo_cmp to handle all program points.
When comparing instructions in the same EBB, behave like the RPO visits instructions in program order. - Add a Layout::pp_ebb() method for convenience. It gets the EBB containing any program point. - Add a conversion from ValueDef to ExpandedProgramPoint so it can be used with the rpo_cmp method.
This commit is contained in:
@@ -63,6 +63,15 @@ impl From<Ebb> for ExpandedProgramPoint {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ValueDef> for ExpandedProgramPoint {
|
||||
fn from(def: ValueDef) -> ExpandedProgramPoint {
|
||||
match def {
|
||||
ValueDef::Res(inst, _) => inst.into(),
|
||||
ValueDef::Arg(ebb, _) => ebb.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ProgramPoint> for ExpandedProgramPoint {
|
||||
fn from(pp: ProgramPoint) -> ExpandedProgramPoint {
|
||||
if pp.0 & 1 == 0 {
|
||||
|
||||
Reference in New Issue
Block a user