Enum peepmatic_runtime::linear::MatchOp[][src]

pub enum MatchOp {
    Opcode(LhsId),
    IsConst(LhsId),
    IsPowerOfTwo(LhsId),
    BitWidth(LhsId),
    FitsInNativeWord(LhsId),
    Eq(LhsIdLhsId),
    IntegerValue(LhsId),
    BooleanValue(LhsId),
    ConditionCode(LhsId),
    Nop,
}
Expand description

A matching operation to be performed on some Cranelift instruction as part of determining whether an optimization is applicable.

Variants

Opcode(LhsId)

Switch on the opcode of an instruction.

Upon successfully matching an instruction’s opcode, bind each of its operands to a LHS temporary.

Tuple Fields of Opcode

0: LhsId
IsConst(LhsId)

Does an instruction have a constant value?

Tuple Fields of IsConst

0: LhsId
IsPowerOfTwo(LhsId)

Is the constant value a power of two?

Tuple Fields of IsPowerOfTwo

0: LhsId
BitWidth(LhsId)

Switch on the bit width of a value.

Tuple Fields of BitWidth

0: LhsId
FitsInNativeWord(LhsId)

Does the value fit in our target architecture’s native word size?

Tuple Fields of FitsInNativeWord

0: LhsId
Eq(LhsIdLhsId)

Are the instructions (or immediates) the same?

Tuple Fields of Eq

0: LhsId1: LhsId
IntegerValue(LhsId)

Switch on the constant integer value of an instruction.

Tuple Fields of IntegerValue

0: LhsId
BooleanValue(LhsId)

Switch on the constant boolean value of an instruction.

Tuple Fields of BooleanValue

0: LhsId
ConditionCode(LhsId)

Switch on a condition code.

Tuple Fields of ConditionCode

0: LhsId
Nop

No operation. Always evaluates to Else.

Never appears in real optimizations; nonetheless required to support corner cases of the DSL, such as a LHS pattern that is nothing but a variable.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.