Commit a95edaa6 authored by qinsoon's avatar qinsoon

[wip] fix log level for some outputs

parent 94d6c0a0
......@@ -637,7 +637,6 @@ impl TreeNode {
match self.v {
TreeNode_::Value(ref val) => val.clone(),
TreeNode_::Instruction(ref inst) => {
warn!("expecting a value, but we found an inst. Instead we use its first value");
let vals = inst.value.as_ref().unwrap();
if vals.len() != 1 {
panic!("we expect an inst with 1 value, but found multiple or zero (it should not be here - folded as a child)");
......@@ -929,7 +928,7 @@ impl fmt::Display for Constant {
&Constant::Float(v) => write!(f, "{}", v),
&Constant::Double(v) => write!(f, "{}", v),
// &Constant::IRef(v) => write!(f, "{}", v),
&Constant::FuncRef(v) => write!(f, "{}", v),
&Constant::FuncRef(v) => write!(f, "FuncRef {}", v),
&Constant::Vector(ref v) => {
write!(f, "[").unwrap();
for i in 0..v.len() {
......
......@@ -1974,7 +1974,9 @@ impl <'a> InstructionSelection {
// new block (no livein)
self.current_block = Some(slowpath.clone());
self.backend.start_block(slowpath.clone());
self.backend.set_block_livein(slowpath.clone(), &vec![size.clone()]);
if size.is_int_reg() {
self.backend.set_block_livein(slowpath.clone(), &vec![size.clone()]);
}
// arg1: allocator address
// arg2: size
......
......@@ -101,7 +101,7 @@ fn emit_muir_dot(func: &MuFunctionVersion, vm: &VM) {
Ok(file) => file
};
emit_muir_dot_inner(&mut file, func_name.clone(), func.get_orig_ir().unwrap(), vm);
emit_muir_dot_inner(&mut file, func_name.clone(), func.get_orig_ir().unwrap());
}
// final
......@@ -115,14 +115,13 @@ fn emit_muir_dot(func: &MuFunctionVersion, vm: &VM) {
Ok(file) => file
};
emit_muir_dot_inner(&mut file, func_name.clone(), func.content.as_ref().unwrap(), vm);
emit_muir_dot_inner(&mut file, func_name.clone(), func.content.as_ref().unwrap());
}
}
fn emit_muir_dot_inner(file: &mut File,
f_name: String,
f_content: &FunctionContent,
vm: &VM) {
f_content: &FunctionContent) {
use utils::vec_utils;
// digraph func {
......
......@@ -646,7 +646,7 @@ impl <'a> GraphColoring<'a> {
trace!("Color {} as {}", self.display_node(n), first_available_color);
if !backend::is_callee_saved(first_available_color) {
warn!("Use caller saved register {}", first_available_color);
trace!("Use caller saved register {}", first_available_color);
}
self.colored_nodes.push(n);
......
......@@ -128,7 +128,7 @@ pub fn validate_regalloc(cf: &CompiledFunction,
}
debug!("{}", alive);
trace!("---");
debug!("---");
}
// find liveout of the block, and only preserve what is in the liveout
......@@ -314,7 +314,7 @@ fn add_def(reg: MuID, reg_assigned: &LinkedHashMap<MuID, MuID>, is_mov: bool, al
// overwrite value, safe
} else {
if is_mov {
warn!("Temp{} and Temp{} is using the same Register{}, possibly coalesced", temp, old_temp, machine_reg);
debug!("Temp{} and Temp{} is using the same Register{}, possibly coalesced", temp, old_temp, machine_reg);
} else {
// trying to overwrite another value, error
error!("Temp{} and Temp{} try use the same Register{}", temp, old_temp, machine_reg);
......
......@@ -23,13 +23,13 @@ pub trait CompilerPass {
fn as_any(&self) -> &Any;
fn execute(&mut self, vm: &VM, func: &mut MuFunctionVersion) {
debug!("---CompilerPass {} for {}---", self.name(), func);
info!("---CompilerPass {} for {}---", self.name(), func);
self.start_function(vm, func);
self.visit_function(vm, func);
self.finish_function(vm, func);
debug!("---finish---");
info!("---finish---");
}
fn visit_function(&mut self, vm: &VM, func: &mut MuFunctionVersion) {
......
......@@ -12,7 +12,7 @@ fn link_executable_internal (files: Vec<PathBuf>, lib: &Vec<String>, libpath: &V
let mut cc = Command::new(get_test_clang_path());
for file in files {
trace!("link with {:?}", file.as_path());
info!("link with {:?}", file.as_path());
cc.arg(file.as_path());
}
......@@ -24,7 +24,7 @@ fn link_executable_internal (files: Vec<PathBuf>, lib: &Vec<String>, libpath: &V
cc.arg(format!("-l{}", l));
}
println!("output as {:?}", out.as_path());
info!("output as {:?}", out.as_path());
if cfg!(target_os = "linux") {
cc.arg("-ldl");
cc.arg("-lrt");
......
......@@ -31,19 +31,19 @@ pub fn exec (cmd: Command) -> Output {
}
pub fn exec_nocheck (mut cmd: Command) -> Output {
trace!("executing: {:?}", cmd);
info!("executing: {:?}", cmd);
let output = match cmd.output() {
Ok(res) => res,
Err(e) => panic!("failed to execute: {}", e)
};
trace!("---out---");
trace!("{}", String::from_utf8_lossy(&output.stdout));
trace!("---err---");
trace!("{}", String::from_utf8_lossy(&output.stderr));
info!("---out---");
info!("{}", String::from_utf8_lossy(&output.stdout));
info!("---err---");
info!("{}", String::from_utf8_lossy(&output.stderr));
if output.status.signal().is_some() {
trace!("terminated by a signal: {}", output.status.signal().unwrap());
info!("terminated by a signal: {}", output.status.signal().unwrap());
}
output
......
......@@ -601,7 +601,7 @@ impl <'a> VM {
fn declare_const_internal(&self, map: &mut RwLockWriteGuard<HashMap<MuID, P<Value>>>, id: MuID, val: P<Value>) {
debug_assert!(!map.contains_key(&id));
info!("declare const #{} = {}", id, val);
trace!("declare const #{} = {}", id, val);
map.insert(id, val);
}
......@@ -695,17 +695,17 @@ impl <'a> VM {
types.insert(id, ty.clone());
info!("declare type #{} = {}", id, ty);
trace!("declare type #{} = {}", id, ty);
if ty.is_struct() {
let tag = ty.get_struct_hybrid_tag().unwrap();
let struct_map_guard = STRUCT_TAG_MAP.read().unwrap();
let struct_inner = struct_map_guard.get(&tag).unwrap();
info!(" {}", struct_inner);
trace!(" {}", struct_inner);
} else if ty.is_hybrid() {
let tag = ty.get_struct_hybrid_tag().unwrap();
let hybrid_map_guard = HYBRID_TAG_MAP.read().unwrap();
let hybrid_inner = hybrid_map_guard.get(&tag).unwrap();
info!(" {}", hybrid_inner);
trace!(" {}", hybrid_inner);
}
}
......
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