pub enum Shown {
Reg,
Const,
Var,
Expand,
}Expand description
How one operand is shown to the matcher.
Variants§
Reg
As a value sitting in a register, which is what (value.iN x) matches.
Const
As a constant the caller has in hand, which is what (iconst.iN k) matches.
Var
As a register that is not a constant, which is what (value.iN x) matches when the
operand is anything other than a number.
This is Shown::Reg with the constants refused. A canonicalisation is a rule that
moves an operand from one side to the other, and the swapped form it writes matches the
rule again the moment the other side is a constant too, which is a term the pass would
rewrite until it ran out of fuel. Saying which side is not a number is what stops it, and
it has to be said in the plan rather than in a guard, because a guard reads a binding as
a number and is false when it is not one.
Expand
As the instruction that computed it, so a rule can be about two instructions at once.