Commit 45372bf4 authored by qinsoon's avatar qinsoon

better formatting on regalloc output. Fix a possible bug

parent 2a81eadd
...@@ -234,7 +234,7 @@ impl InterferenceGraph { ...@@ -234,7 +234,7 @@ impl InterferenceGraph {
}; };
if !self.adj_set.contains(&(u, v)) && u != v { if !self.adj_set.contains(&(u, v)) && u != v {
trace!("add edge ({}, {})", u, v); trace!(" add edge ({}, {})", u, v);
self.adj_set.insert((u, v)); self.adj_set.insert((u, v));
self.adj_set.insert((v, u)); self.adj_set.insert((v, u));
...@@ -243,13 +243,13 @@ impl InterferenceGraph { ...@@ -243,13 +243,13 @@ impl InterferenceGraph {
self.adj_list.get_mut(&u).unwrap().insert(v); self.adj_list.get_mut(&u).unwrap().insert(v);
let degree = self.get_degree_of(u); let degree = self.get_degree_of(u);
self.set_degree_of(u, degree + 1); self.set_degree_of(u, degree + 1);
trace!(" increase degree of {} to {}", u, degree + 1); trace!(" increase degree of {} to {}", u, degree + 1);
} }
if !is_precolored(v) { if !is_precolored(v) {
self.adj_list.get_mut(&v).unwrap().insert(u); self.adj_list.get_mut(&v).unwrap().insert(u);
let degree = self.get_degree_of(v); let degree = self.get_degree_of(v);
self.set_degree_of(v, degree + 1); self.set_degree_of(v, degree + 1);
trace!(" increase degree of {} to {}", v, degree + 1); trace!(" increase degree of {} to {}", v, degree + 1);
} }
} }
} }
...@@ -310,7 +310,7 @@ impl InterferenceGraph { ...@@ -310,7 +310,7 @@ impl InterferenceGraph {
} }
pub fn set_degree_of(&mut self, reg: MuID, degree: usize) { pub fn set_degree_of(&mut self, reg: MuID, degree: usize) {
trace!(" set degree({}) = {}", reg, degree); trace!(" (set degree({}) = {})", reg, degree);
self.degree.insert(reg, degree); self.degree.insert(reg, degree);
} }
......
...@@ -21,7 +21,7 @@ use utils::math::align_up; ...@@ -21,7 +21,7 @@ use utils::math::align_up;
use utils::bit_utils::bits_ones; use utils::bit_utils::bits_ones;
use std; use std;
pub static mut VALIDATE_IR: bool = true; pub static mut VALIDATE_IR: bool = false;
macro_rules! assert_ir { macro_rules! assert_ir {
($ cond : expr ) => [{if unsafe{VALIDATE_IR} {assert!($cond)} }]; ($ cond : expr ) => [{if unsafe{VALIDATE_IR} {assert!($cond)} }];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment