From dcb95541a7a16564db4b15f9248ceab990a18135 Mon Sep 17 00:00:00 2001 From: T0b1 Date: Fri, 14 Apr 2023 19:36:21 +0200 Subject: [PATCH] only do clobber string computation if tracing --- src/ion/fast_alloc.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ion/fast_alloc.rs b/src/ion/fast_alloc.rs index c5cec9a..3d6141b 100644 --- a/src/ion/fast_alloc.rs +++ b/src/ion/fast_alloc.rs @@ -445,15 +445,17 @@ fn allocate_block_insts<'a, F: Function>( state.func.is_branch(inst), alloc_idx ); - let mut str = String::new(); - for preg in clobbers { - if str.is_empty() { - str.push_str(&format!("{}", preg)); - } else { - str.push_str(&format!(", {}", preg)); + if trace_enabled!() { + let mut str = String::new(); + for preg in clobbers { + if str.is_empty() { + 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 // TODO: wouldnt need this if we look up the inst a vreg was allocated at