Commit 1c69069c authored by qinsoon's avatar qinsoon

wont generate mov from tmp_a to tmp_a in intermediate block. No longer

put binop/move as tree child
parent e0dd25b3
Pipeline #1244 passed with stages
in 54 minutes and 2 seconds
......@@ -4485,7 +4485,12 @@ pub fn spill_rewrite(
.clone_value();
// maintain mapping
trace!("reg {} used in Inst{} is replaced as {}", val_reg, i, temp);
trace!(
"reg {} used in Inst{} is replaced as {}",
val_reg.id(),
i,
temp
);
spilled_scratch_temps.insert(temp.id(), reg);
// generate a load
......@@ -4542,7 +4547,7 @@ pub fn spill_rewrite(
};
trace!(
"reg {} defined in Inst{} is replaced as {}",
val_reg,
val_reg.id(),
i,
temp
);
......
......@@ -243,13 +243,13 @@ impl InterferenceGraph {
self.adj_list.get_mut(&u).unwrap().insert(v);
let degree = self.get_degree_of(u);
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) {
self.adj_list.get_mut(&v).unwrap().insert(u);
let degree = self.get_degree_of(v);
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 {
}
pub fn set_degree_of(&mut self, reg: MuID, degree: usize) {
debug!("DEGREE({}) SET TO {}", reg, degree);
trace!(" set degree({}) = {}", reg, degree);
self.degree.insert(reg, degree);
}
......
......@@ -54,6 +54,7 @@ impl<'vm> Compiler<'vm> {
/// compiles a certain function version
pub fn compile(&self, func: &mut MuFunctionVersion) {
info!("");
info!("compilation_start {}", func.id());
info!("Start compiling {}", func);
info!("");
debug!("{:?}", func);
......@@ -78,6 +79,7 @@ impl<'vm> Compiler<'vm> {
// build exception table for this function
unimplemented!()
}
info!("compilation_end {}", func.id());
}
}
......
......@@ -324,6 +324,10 @@ impl CompilerPass for GenMovPhi {
// move every from_arg to target_arg
let mut i = 0;
for arg in block_info.from_args.iter() {
let ref target_arg = target_args[i];
// when a block branches to itself, it is possible that
// arg is the same as target_arg
if arg.as_value() != target_arg {
let m = func.new_inst(Instruction {
hdr: MuEntityHeader::unnamed(vm.next_id()),
value: Some(vec![target_args[i].clone()]),
......@@ -332,6 +336,7 @@ impl CompilerPass for GenMovPhi {
});
vec.push(m);
}
i += 1;
}
......
......@@ -89,8 +89,8 @@ fn is_suitable_child(inst: &Instruction) -> bool {
AtomicRMW { .. } |
Store { .. } => false,
BinOp(_, _, _) |
BinOpWithStatus(_, _, _, _) |
BinOp(_, _, _) | BinOpWithStatus(_, _, _, _) | CommonInst_GetThreadLocal | Move(_) => false,
CmpOp(_, _, _) |
ConvOp { .. } |
Load { .. } |
......@@ -98,9 +98,7 @@ fn is_suitable_child(inst: &Instruction) -> bool {
GetFieldIRef { .. } |
GetElementIRef { .. } |
ShiftIRef { .. } |
GetVarPartIRef { .. } |
CommonInst_GetThreadLocal |
Move(_) => true
GetVarPartIRef { .. } => true
}
}
......
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