pub enum Constraint {
Reg,
Any,
Stack,
Fixed(PhysReg),
Reuse(u8),
}Expand description
Where an operand is allowed to live.
The set is regalloc2’s, which spec/10-backend.md section 10.4 says the allocator interface
follows. Constraint::Reg is the default rather than Constraint::Any because a machine
instruction wants its operands in registers unless it has said otherwise, and a default that
permits a stack slot would turn every rule that forgot to say so into a spill.
Variants§
Reg
Any register of its class.
Any
A register or a stack slot, whichever the allocator prefers.
Stack
A stack slot, which is what an operand too large for a register asks for.
Fixed(PhysReg)
That register and no other, which is how a call says where an argument goes and how a division says where its dividend goes.
Reuse(u8)
The same register as the operand at that index, which is what a two-address form on x86-64 needs: the destination is the first source, and the allocator is the one that has to make that true.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more