From 60efc6893197cdf1c39e9f39686d4ee3c0686ef2 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Wed, 5 Jul 2017 14:22:34 -0700 Subject: [PATCH] Only print pressure for toprcs containing registers. Many ISAs don't need 4 top-level register classes, so don't print them. --- lib/cretonne/src/regalloc/pressure.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cretonne/src/regalloc/pressure.rs b/lib/cretonne/src/regalloc/pressure.rs index 3bf1e68f54..fd9cf7c363 100644 --- a/lib/cretonne/src/regalloc/pressure.rs +++ b/lib/cretonne/src/regalloc/pressure.rs @@ -238,7 +238,9 @@ impl fmt::Display for Pressure { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Pressure[")?; for rc in &self.toprc { - write!(f, " {}+{}/{}", rc.base_count, rc.transient_count, rc.limit)?; + if rc.limit > 0 { + write!(f, " {}+{}/{}", rc.base_count, rc.transient_count, rc.limit)?; + } } write!(f, " ]") }