The MatchTable is encoded as an array of bytes. Thus, opcodes are expected to be <255.
Synopsis
Declared in <llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h>
enum Unnamed enum;
Description
Operands can be variable‐sized, their size is always after their name in the docs, e.g. "Foo(4)" means that "Foo" takes 4 entries in the table, so 4 bytes. "Foo()"
As a general rule of thumb:
-
Instruction & Operand IDs are ULEB128
-
LLT IDs are 1 byte
-
Predicates and target opcodes, register and register class IDs are 2 bytes.
-
Indexes into the table are 4 bytes.
-
Inline constants are 8 bytes
Design notes:
-
Inst/Op IDs have to be LEB128 because some targets generate extremely long patterns which need more than 255 temporaries. We could just use 2 bytes everytime, but then some targets like X86/AMDGPU that have no need for it will pay the price all the time.
Members
Name |
Description |
|
Begin a try‐block to attempt a match and jump to OnFail if it is unsuccessful. ‐ OnFail(4) ‐ The MatchTable entry at which to resume if the match fails. |
|
GIM_Try only if the feature bits match. ‐ OnFail(4) ‐ The MatchTable entry at which to resume if the match fails. ‐ Feature(2) ‐ Expected features |
|
Switch over the opcode on the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID ‐ LowerBound(2) ‐ numerically minimum opcode supported ‐ UpperBound(2) ‐ numerically maximum + 1 opcode supported ‐ Default(4) ‐ failure jump target ‐ JumpTable(4)... ‐ (UpperBound ‐ LowerBound) (at least 2) jump targets |
|
Switch over the LLT on the specified instruction operand ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ LowerBound(2) ‐ numerically minimum Type ID supported ‐ UpperBound(2) ‐ numerically maximum + 1 Type ID supported ‐ Default(4) ‐ failure jump target ‐ JumpTable(4)... ‐ (UpperBound ‐ LowerBound) (at least 2) jump targets |
|
Switch over the shape of an LLT on the specified instruction operand ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ LowerBound(2) ‐ numerically minimum Type ID supported ‐ UpperBound(2) ‐ numerically maximum + 1 Type ID supported ‐ Default(4) ‐ failure jump target ‐ JumpTable(4)... ‐ (UpperBound ‐ LowerBound) (at least 2) jump targets |
|
Record the specified instruction. The IgnoreCopies variant ignores COPY instructions. ‐ NewInsnID(ULEB128) ‐ Instruction ID to define ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index |
|
Record the specified instruction. The IgnoreCopies variant ignores COPY instructions. ‐ NewInsnID(ULEB128) ‐ Instruction ID to define ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index |
|
Check the opcode on the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Opc(2) ‐ Expected opcode |
|
Check the opcode on the specified instruction, checking 2 acceptable alternatives. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Opc(2) ‐ Expected opcode ‐ Opc(2) ‐ Alternative expected opcode |
|
Check the instruction has the right number of operands ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ops(ULEB128) ‐ Expected number of operands |
|
Check the instruction has a number of operands <= or >= than given number. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ops(ULEB128) ‐ Number of operands |
|
Check the instruction has a number of operands <= or >= than given number. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ops(ULEB128) ‐ Number of operands |
|
Check an immediate predicate on the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Pred(2) ‐ The predicate to test |
|
Check an immediate predicate on the specified instruction via an APInt. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Pred(2) ‐ The predicate to test |
|
Check a floating point immediate predicate on the specified instruction. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Pred(2) ‐ The predicate to test |
|
Check an immediate predicate on the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Pred(2) ‐ The predicate to test |
|
Check a leaf predicate on the specified instruction. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Pred(2) ‐ The predicate to test |
|
Check a memory operation has the specified atomic ordering. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ordering(ULEB128) ‐ The AtomicOrdering value |
|
Check a memory operation has the specified atomic ordering. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ordering(ULEB128) ‐ The AtomicOrdering value |
|
Check a memory operation has the specified atomic ordering. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ Ordering(ULEB128) ‐ The AtomicOrdering value |
|
Check the size of the memory access for the given machine memory operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ Size(4) ‐ The size in bytes of the memory access |
|
Check the address space of the memory access for the given machine memory operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ NumAddrSpace(1) ‐ Number of valid address spaces ‐ AddrSpaceN(ULEB128) ‐ An allowed space of the memory access ‐ AddrSpaceN+1 ... |
|
Check the minimum alignment of the memory access for the given machine memory operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ MinAlign(1) ‐ Minimum acceptable alignment |
|
Check the size of the memory access for the given machine memory operand against the size of an operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ OpIdx(ULEB128) ‐ The operand index to compare the MMO against |
|
Check the size of the memory access for the given machine memory operand against the size of an operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ OpIdx(ULEB128) ‐ The operand index to compare the MMO against |
|
Check the size of the memory access for the given machine memory operand against the size of an operand. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ MMOIdx(ULEB128) ‐ MMO index ‐ OpIdx(ULEB128) ‐ The operand index to compare the MMO against |
|
Check if this is a vector that can be treated as a vector splat constant. This is valid for both G_BUILD_VECTOR as well as G_BUILD_VECTOR_TRUNC. For AllOnes refers to individual bits, so a ‐1 element. ‐ InsnID(ULEB128) ‐ Instruction ID |
|
Check if this is a vector that can be treated as a vector splat constant. This is valid for both G_BUILD_VECTOR as well as G_BUILD_VECTOR_TRUNC. For AllOnes refers to individual bits, so a ‐1 element. ‐ InsnID(ULEB128) ‐ Instruction ID |
|
Check a trivial predicate which takes no arguments. This can be used by executors to implement custom flags that don't fit in target features. ‐ Pred(2) ‐ Predicate ID to check. |
|
Check a generic C++ instruction predicate ‐ InsnID(ULEB128) ‐ Instruction ID ‐ PredicateID(2) ‐ The ID of the predicate function to call |
|
Check if there's no use of the first result. ‐ InsnID(ULEB128) ‐ Instruction ID |
|
Check if there's one use of the first result. ‐ InsnID(ULEB128) ‐ Instruction ID |
|
Check the type for the specified operand ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Ty(1) ‐ Expected type |
|
GIM_CheckType but InsnID is omitted and defaults to zero. |
|
Check the type of a pointer to any address space. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ SizeInBits(ULEB128) ‐ The size of the pointer value in bits. |
|
Check the register bank for the specified operand ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ RC(2) ‐ Expected register bank (specified as a register class) |
|
GIM_CheckRegBankForClass but InsnID is omitted and defaults to zero. |
|
Check the operand matches a complex predicate ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ RendererID(2) ‐ The renderer to hold the result ‐ Pred(2) ‐ Complex predicate ID |
|
Check the operand is a specific integer ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Val(8) Expected integer |
|
Check the operand is a specific 8‐bit signed integer ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Val(1) Expected integer |
|
Check the operand is a specific literal integer (i.e. MO.isImm() or MO.isCImm() is true). ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Val(8) ‐ Expected integer |
|
Check the operand is a specific intrinsic ID ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ IID(2) ‐ Expected Intrinsic ID |
|
Check the operand is a specific predicate ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ Pred(2) ‐ Expected predicate |
|
Check the specified operand is an MBB ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index |
|
Check the specified operand is an Imm ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index |
|
Checks if the matched instructions numbered [1, 1+N) can] be folded into the root (inst 0). ‐ Num(1) |
|
Check the specified operands are identical. The IgnoreCopies variant looks through COPY instructions before comparing the operands. The "All" variants check all operands starting from the index. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ OtherInsnID(ULEB128) ‐ Other instruction ID ‐ OtherOpIdx(ULEB128) ‐ Other operand index |
|
Check the specified operands are identical. The IgnoreCopies variant looks through COPY instructions before comparing the operands. The "All" variants check all operands starting from the index. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ OtherInsnID(ULEB128) ‐ Other instruction ID ‐ OtherOpIdx(ULEB128) ‐ Other operand index |
|
Check the specified operands are identical. The IgnoreCopies variant looks through COPY instructions before comparing the operands. The "All" variants check all operands starting from the index. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ OtherInsnID(ULEB128) ‐ Other instruction ID ‐ OtherOpIdx(ULEB128) ‐ Other operand index |
|
Check the specified operands are identical. The IgnoreCopies variant looks through COPY instructions before comparing the operands. The "All" variants check all operands starting from the index. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ OtherInsnID(ULEB128) ‐ Other instruction ID ‐ OtherOpIdx(ULEB128) ‐ Other operand index |
|
Check we can replace all uses of a register with another. ‐ OldInsnID(ULEB128) ‐ OldOpIdx(ULEB128) ‐ NewInsnID(ULEB128) ‐ NewOpIdx(ULEB128) |
|
Check that a matched instruction has, or doesn't have a MIFlag. |
|
Check that a matched instruction has, or doesn't have a MIFlag. |
|
Predicates with 'let PredicateCodeUsesOperands = 1' need to examine some named operands that will be recorded in RecordedOperands. Names of these operands are referenced in predicate argument list. Emitter determines StoreIdx(corresponds to the order in which names appear in argument list). ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ StoreIdx(ULEB128) ‐ Store location in RecordedOperands. |
|
Records an operand's register type into the set of temporary types. ‐ InsnID(ULEB128) ‐ Instruction ID ‐ OpIdx(ULEB128) ‐ Operand index ‐ TempTypeIdx(1) ‐ Temp Type Index, always negative. |
|
Fail the current try‐block, or completely fail to match if there is no current try‐block. |
|
Mutate an instruction ‐ NewInsnID(ULEB128) ‐ Instruction ID to define ‐ OldInsnID(ULEB128) ‐ Instruction ID to mutate ‐ NewOpcode(2) ‐ The new opcode to use |
|
Build a new instruction ‐ InsnID(ULEB128) ‐ Instruction ID to define ‐ Opcode(2) ‐ The new opcode to use |
|
GIR_BuildMI but InsnID is omitted and defaults to zero. |
|
Builds a constant and stores its result in a TempReg. ‐ TempRegID(ULEB128) ‐ Temp Register to define. ‐ Imm(8) ‐ The immediate to add |
|
Copy an operand to the specified instruction ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from ‐ OpIdx(ULEB128) ‐ The operand to copy |
|
GIR_Copy but with both New/OldInsnIDs omitted and defaulting to zero. |
|
Copies all operand starting from OpIdx in OldInsnID into the new instruction NewInsnID. ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from ‐ OpIdx(ULEB128) ‐ The first operand to copy |
|
Copy an operand to the specified instruction or add a zero register if the operand is a zero immediate. ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from ‐ OpIdx(ULEB128) ‐ The operand to copy ‐ ZeroReg(2) ‐ The zero register to use |
|
Copy an operand to the specified instruction ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from ‐ OpIdx(ULEB128) ‐ The operand to copy ‐ SubRegIdx(2) ‐ The subregister to copy |
|
Add an implicit register def to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RegNum(2) ‐ The register to add ‐ Flags(2) ‐ Register Flags |
|
Add an implicit register use to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RegNum(2) ‐ The register to add |
|
Add an register to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RegNum(2) ‐ The register to add ‐ Flags(2) ‐ Register Flags |
|
Adds an intrinsic ID to the specified instruction. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ IID(2) ‐ Intrinsic ID |
|
Marks the implicit def of a register as dead. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ OpIdx(ULEB128) ‐ The implicit def operand index |
|
Set or unset a MIFlag on an instruction. |
|
Set or unset a MIFlag on an instruction. |
|
Copy the MIFlags of a matched instruction into an output instruction. The flags are OR'd together. |
|
Add a temporary register to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ TempRegID(ULEB128) ‐ The temporary register ID to add ‐ TempRegFlags(2) ‐ The register flags to set |
|
Add a temporary register to the specified instruction without setting any flags. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ TempRegID(ULEB128) ‐ The temporary register ID to add |
|
Add a temporary register to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ TempRegID(ULEB128) ‐ The temporary register ID to add ‐ TempRegFlags(2) ‐ The register flags to set ‐ SubRegIndex(2) ‐ The subregister index to set |
|
Add an immediate to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ Imm(8) ‐ The immediate to add |
|
Add signed 8 bit immediate to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ Imm(1) ‐ The immediate to add |
|
Add an CImm to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ Ty(1) ‐ Type of the constant immediate. ‐ Imm(8) ‐ The immediate to add |
|
Render complex operands to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RendererID(2) ‐ The renderer to call |
|
Render sub‐operands of complex operands to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RendererID(2) ‐ The renderer to call ‐ RenderOpID(ULEB128) ‐ The suboperand to render. |
|
Render subregisters of suboperands of complex operands to the specified instruction ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ RendererID(2) ‐ The renderer to call ‐ RenderOpID(ULEB128) ‐ The suboperand to render ‐ SubRegIdx(2) ‐ The subregister to extract |
|
Render operands to the specified instruction using a custom function ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to get the matched operand from ‐ RendererFnID(2) ‐ Custom renderer function to call |
|
Calls a C++ function that concludes the current match. The C++ function is free to return false and reject the match, or return true and mutate the instruction(s) (or do nothing, even). ‐ FnID(2) ‐ The function to call. |
|
Render operands to the specified instruction using a custom function, reading from a specific operand. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to get the matched operand from ‐ OpIdx(ULEB128) ‐ Operand index in OldInsnID the render function should read from.. ‐ RendererFnID(2) ‐ Custom renderer function to call |
|
Render a G_CONSTANT operator as a sign‐extended immediate. ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from The operand index is implicitly 1. |
|
Render a G_FCONSTANT operator as a sign‐extended immediate. ‐ NewInsnID(ULEB128) ‐ Instruction ID to modify ‐ OldInsnID(ULEB128) ‐ Instruction ID to copy from The operand index is implicitly 1. |
|
Constrain an instruction operand to a register class. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ OpIdx(ULEB128) ‐ Operand index ‐ RCEnum(2) ‐ Register class enumeration value |
|
Constrain an instructions operands according to the instruction description. ‐ InsnID(ULEB128) ‐ Instruction ID to modify |
|
GIR_ConstrainSelectedInstOperands but InsnID is omitted and defaults to zero. |
|
Merge all memory operands into instruction. ‐ InsnID(ULEB128) ‐ Instruction ID to modify ‐ NumInsnID(1) ‐ Number of instruction IDs following this argument ‐ MergeInsnID(ULEB128)... ‐ One or more Instruction ID to merge into the result. |
|
Erase from parent. ‐ InsnID(ULEB128) ‐ Instruction ID to erase |
|
Combines both a GIR_EraseFromParent 0 + GIR_Done |
|
Create a new temporary register that's not constrained. ‐ TempRegID(ULEB128) ‐ The temporary register ID to initialize. ‐ Ty(1) ‐ Expected type |
|
Replaces all references to a register from an instruction with another register from another instruction. ‐ OldInsnID(ULEB128) ‐ OldOpIdx(ULEB128) ‐ NewInsnID(ULEB128) ‐ NewOpIdx(ULEB128) |
|
Replaces all references to a register with a temporary register. ‐ OldInsnID(ULEB128) ‐ OldOpIdx(ULEB128) ‐ TempRegIdx(ULEB128) |
|
A successful emission |
|
Increment the rule coverage counter. ‐ RuleID(4) ‐ The ID of the rule that was covered. |
|
Keeping track of the number of the GI opcodes. Must be the last entry. |
Created with MrDocs