Simplify the arguments() return type.
Now that variable arguments are always stored in a value list with the fixed arguments, we no longer need the arcane [&[Value]; 2] return type. Arguments are always stored contiguously, so just return a &[Value] slice. Also remove the each_arg() methods which were just trying to make it easier to work with the old slice pair.
This commit is contained in:
@@ -299,7 +299,7 @@ impl<'a> Context<'a> {
|
||||
}
|
||||
ConstraintKind::Tied(arg_index) => {
|
||||
// This def must use the same register as a fixed instruction argument.
|
||||
let arg = dfg[inst].arguments(&dfg.value_lists)[0][arg_index as usize];
|
||||
let arg = dfg[inst].arguments(&dfg.value_lists)[arg_index as usize];
|
||||
let loc = locations[arg];
|
||||
*locations.ensure(lv.value) = loc;
|
||||
// Mark the reused register. It's not really clear if we support tied
|
||||
|
||||
@@ -318,7 +318,7 @@ impl Liveness {
|
||||
let mut operand_constraints =
|
||||
recipe_constraints.get(recipe).map(|c| c.ins).unwrap_or(&[]).iter();
|
||||
|
||||
func.dfg[inst].each_arg(&func.dfg.value_lists, |arg| {
|
||||
for &arg in func.dfg[inst].arguments(&func.dfg.value_lists) {
|
||||
// Get the live range, create it as a dead range if necessary.
|
||||
let lr = get_or_create(&mut self.ranges, arg, func, recipe_constraints);
|
||||
|
||||
@@ -333,7 +333,7 @@ impl Liveness {
|
||||
if let Some(constraint) = operand_constraints.next() {
|
||||
lr.affinity.merge(constraint, ®_info);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user