pub enum Refusal {
Twice(Inst),
Gone(Inst),
Unknown(Inst),
Operands(Inst),
Imm(Inst),
Mem(Inst),
Scale(Inst),
Read(Inst),
Class(Inst),
Edge(Block, usize),
Args(Block, usize),
}Expand description
Why the target or the function would not have a set.
One instruction’s refusal rather than the set’s, because a pass that wants to know what it did wrong wants to know where, and because the tests below are clearer for it. Every one of them turns down the set it is in.
Variants§
Twice(Inst)
The set names that instruction twice, so what it becomes depends on which half wins.
Gone(Inst)
That instruction is not in the function, which is a set built against a function something else has changed since.
Unknown(Inst)
This target has no instruction of that name.
Operands(Inst)
The operand vector is not the shape the opcode’s description says it is.
Imm(Inst)
An immediate on an instruction that carries none, or none on one that does.
Mem(Inst)
An addressing mode on an instruction that has none, or none on one that does.
Scale(Inst)
An index multiplied by something this machine cannot write.
Read(Inst)
Taking that instruction out would leave something reading a register it wrote.
Class(Inst)
A rename would put a register of one class where the instruction reads another.
Edge(Block, usize)
The set says twice what one edge carries, or the block it leaves has no such edge.
Args(Block, usize)
What the set would have an edge carry is not as many values as the block it goes to takes.