Skip to content
Snippets Groups Projects

Integrate anti-dependencies, clone detection, and basic block assignment

Merged rarbore2 requested to merge clone_detection5 into main
26 files
+ 1295
917
Compare changes
  • Side-by-side
  • Inline
Files
26
+ 7
10
@@ -24,7 +24,6 @@ pub fn cpu_codegen<W: Write>(
@@ -24,7 +24,6 @@ pub fn cpu_codegen<W: Write>(
reverse_postorder: &Vec<NodeID>,
reverse_postorder: &Vec<NodeID>,
typing: &Vec<TypeID>,
typing: &Vec<TypeID>,
control_subgraph: &Subgraph,
control_subgraph: &Subgraph,
antideps: &Vec<(NodeID, NodeID)>,
bbs: &BasicBlocks,
bbs: &BasicBlocks,
w: &mut W,
w: &mut W,
) -> Result<(), Error> {
) -> Result<(), Error> {
@@ -36,7 +35,6 @@ pub fn cpu_codegen<W: Write>(
@@ -36,7 +35,6 @@ pub fn cpu_codegen<W: Write>(
reverse_postorder,
reverse_postorder,
typing,
typing,
control_subgraph,
control_subgraph,
antideps,
bbs,
bbs,
};
};
ctx.codegen_function(w)
ctx.codegen_function(w)
@@ -50,7 +48,6 @@ struct CPUContext<'a> {
@@ -50,7 +48,6 @@ struct CPUContext<'a> {
reverse_postorder: &'a Vec<NodeID>,
reverse_postorder: &'a Vec<NodeID>,
typing: &'a Vec<TypeID>,
typing: &'a Vec<TypeID>,
control_subgraph: &'a Subgraph,
control_subgraph: &'a Subgraph,
antideps: &'a Vec<(NodeID, NodeID)>,
bbs: &'a BasicBlocks,
bbs: &'a BasicBlocks,
}
}
@@ -524,12 +521,6 @@ impl<'a> CPUContext<'a> {
@@ -524,12 +521,6 @@ impl<'a> CPUContext<'a> {
self.get_value(data, true),
self.get_value(data, true),
index_ptr_name
index_ptr_name
)?;
)?;
write!(
body,
" {} = bitcast {} to ptr\n",
self.get_value(id, false),
self.get_value(collect, true)
)?;
} else {
} else {
// If the data item being written is not a primitive type,
// If the data item being written is not a primitive type,
// then perform a memcpy from the data collection to the
// then perform a memcpy from the data collection to the
@@ -543,6 +534,12 @@ impl<'a> CPUContext<'a> {
@@ -543,6 +534,12 @@ impl<'a> CPUContext<'a> {
data_size
data_size
)?;
)?;
}
}
 
write!(
 
body,
 
" {} = bitcast {} to ptr\n",
 
self.get_value(id, false),
 
self.get_value(collect, true)
 
)?;
}
}
_ => panic!("PANIC: Can't lower {:?}.", self.function.nodes[id.idx()]),
_ => panic!("PANIC: Can't lower {:?}.", self.function.nodes[id.idx()]),
}
}
@@ -732,7 +729,7 @@ impl<'a> CPUContext<'a> {
@@ -732,7 +729,7 @@ impl<'a> CPUContext<'a> {
// the dynamic constant bounds.
// the dynamic constant bounds.
let mut acc_size = self.codegen_type_size(elem, body)?;
let mut acc_size = self.codegen_type_size(elem, body)?;
for dc in bounds {
for dc in bounds {
acc_size = Self::multiply(&acc_size, &format!("dc{}", dc.idx()), body)?;
acc_size = Self::multiply(&acc_size, &format!("%dc{}", dc.idx()), body)?;
}
}
Ok(acc_size)
Ok(acc_size)
}
}
Loading