Add fixed-non-allocatable operand support (#77)

This allows a non-allocatable `PReg` to be passed on directly to the
allocations vector without any liverange tracking from the register
allocator. The main intended use case is to support ISA-specific special
registers such as a fixed zero register.
This commit is contained in:
Amanieu d'Antras
2022-09-20 03:23:53 +08:00
committed by GitHub
parent aeef47a06b
commit 1495c1e342
6 changed files with 67 additions and 13 deletions

View File

@@ -460,19 +460,21 @@ impl CheckerState {
return Err(CheckerError::MissingAllocation { inst, op });
}
match val {
CheckerValue::Universe => {
return Err(CheckerError::UnknownValueInAllocation { inst, op, alloc });
if op.as_fixed_nonallocatable().is_none() {
match val {
CheckerValue::Universe => {
return Err(CheckerError::UnknownValueInAllocation { inst, op, alloc });
}
CheckerValue::VRegs(vregs) if !vregs.contains(&op.vreg()) => {
return Err(CheckerError::IncorrectValuesInAllocation {
inst,
op,
alloc,
actual: vregs.clone(),
});
}
_ => {}
}
CheckerValue::VRegs(vregs) if !vregs.contains(&op.vreg()) => {
return Err(CheckerError::IncorrectValuesInAllocation {
inst,
op,
alloc,
actual: vregs.clone(),
});
}
_ => {}
}
self.check_constraint(inst, op, alloc, allocs, checker)?;