Skip to content
Snippets Groups Projects

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

Merged rarbore2 requested to merge clone_detection5 into main
Files
26
+ 7
10
@@ -24,7 +24,6 @@ pub fn cpu_codegen<W: Write>(
reverse_postorder: &Vec<NodeID>,
typing: &Vec<TypeID>,
control_subgraph: &Subgraph,
antideps: &Vec<(NodeID, NodeID)>,
bbs: &BasicBlocks,
w: &mut W,
) -> Result<(), Error> {
@@ -36,7 +35,6 @@ pub fn cpu_codegen<W: Write>(
reverse_postorder,
typing,
control_subgraph,
antideps,
bbs,
};
ctx.codegen_function(w)
@@ -50,7 +48,6 @@ struct CPUContext<'a> {
reverse_postorder: &'a Vec<NodeID>,
typing: &'a Vec<TypeID>,
control_subgraph: &'a Subgraph,
antideps: &'a Vec<(NodeID, NodeID)>,
bbs: &'a BasicBlocks,
}
@@ -524,12 +521,6 @@ impl<'a> CPUContext<'a> {
self.get_value(data, true),
index_ptr_name
)?;
write!(
body,
" {} = bitcast {} to ptr\n",
self.get_value(id, false),
self.get_value(collect, true)
)?;
} else {
// If the data item being written is not a primitive type,
// then perform a memcpy from the data collection to the
@@ -543,6 +534,12 @@ impl<'a> CPUContext<'a> {
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()]),
}
@@ -732,7 +729,7 @@ impl<'a> CPUContext<'a> {
// the dynamic constant bounds.
let mut acc_size = self.codegen_type_size(elem, body)?;
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)
}
Loading