Skip to content
Snippets Groups Projects

Add set ops to scheduler

Merged Aaron Councilman requested to merge label_set_ops into main
8 files
+ 486
302
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 4
13
@@ -108,9 +108,8 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
}
}
// Constructs an editor but only makes the nodes with at least one of the
// set of labels as mutable.
pub fn new_labeled(
// Constructs an editor with a specified mask determining which nodes are mutable
pub fn new_mask(
function: &'a mut Function,
function_id: FunctionID,
constants: &'a RefCell<Vec<Constant>>,
@@ -118,7 +117,7 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
types: &'a RefCell<Vec<Type>>,
labels: &'a RefCell<Vec<String>>,
def_use: &ImmutableDefUseMap,
with_labels: &HashSet<LabelID>,
mask: BitVec<u8, Lsb0>,
) -> Self {
let mut_def_use = (0..function.nodes.len())
.map(|idx| {
@@ -130,14 +129,6 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
})
.collect();
let mut mutable_nodes = bitvec![u8, Lsb0; 0; function.nodes.len()];
// Add all nodes which have some label which is in the with_labels set
for (idx, labels) in function.labels.iter().enumerate() {
if !labels.is_disjoint(with_labels) {
mutable_nodes.set(idx, true);
}
}
FunctionEditor {
function,
function_id,
@@ -146,7 +137,7 @@ impl<'a: 'b, 'b> FunctionEditor<'a> {
types,
labels,
mut_def_use,
mutable_nodes,
mutable_nodes: mask,
modified: false,
}
}
Loading