Only emit DefAlloc edits when the "checker" feature is enabled.

This reduces instruction counts by ~2% when disabled.
This commit is contained in:
Amanieu d'Antras
2022-01-11 11:32:16 +00:00
parent d95a9d9399
commit 693fb6a975
5 changed files with 121 additions and 113 deletions

View File

@@ -18,6 +18,7 @@ pub struct RedundantMoveEliminator {
#[derive(Copy, Clone, Debug)]
pub struct RedundantMoveAction {
pub elide: bool,
#[cfg(feature = "checker")]
pub def_alloc: Option<(Allocation, VReg)>,
}
@@ -58,6 +59,7 @@ impl RedundantMoveEliminator {
.insert(to, RedundantMoveState::Orig(to_vreg.unwrap()));
return RedundantMoveAction {
elide: true,
#[cfg(feature = "checker")]
def_alloc: Some((to, to_vreg.unwrap())),
};
}
@@ -111,7 +113,11 @@ impl RedundantMoveEliminator {
.push(to);
}
RedundantMoveAction { elide, def_alloc }
RedundantMoveAction {
elide,
#[cfg(feature = "checker")]
def_alloc,
}
}
pub fn clear(&mut self) {