only do clobber string computation if tracing

This commit is contained in:
T0b1
2023-04-14 19:36:21 +02:00
parent 2c8b9a680f
commit dcb95541a7

View File

@@ -445,15 +445,17 @@ fn allocate_block_insts<'a, F: Function>(
state.func.is_branch(inst), state.func.is_branch(inst),
alloc_idx alloc_idx
); );
let mut str = String::new(); if trace_enabled!() {
for preg in clobbers { let mut str = String::new();
if str.is_empty() { for preg in clobbers {
str.push_str(&format!("{}", preg)); if str.is_empty() {
} else { str.push_str(&format!("{}", preg));
str.push_str(&format!(", {}", preg)); } else {
str.push_str(&format!(", {}", preg));
}
} }
trace!("Clobbers: {}", str);
} }
trace!("Clobbers: {}", str);
// keep track of which pregs where allocated so we can clear them later on // keep track of which pregs where allocated so we can clear them later on
// TODO: wouldnt need this if we look up the inst a vreg was allocated at // TODO: wouldnt need this if we look up the inst a vreg was allocated at