Matchers for GlobalISel SSA MachineInstr patterns.

Types

Name

Description

AllOnesConstantMatch

Matches an integer constant with all bits set, regardless of width.

And

Empty And combinator that always matches.

AnyImmMatch

Matches any immediate operand.

BinaryOp_match

Matcher for a fixed binary generic opcode such as G_ADD or G_SUB.

BinaryOpc_match

Matcher for a binary generic opcode supplied at construction time.

BindImmMatch

Matcher that binds an immediate operand's value.

CheckType

Matcher that requires a register to have a specific LLT.

ClassifyOp_match

Matcher for a classify‐style opcode such as G_IS_FPCLASS.

CompareOp_match

Matcher for generic compare opcodes such as G_ICMP and G_FCMP.

ConstantMatch

Matcher that binds an integer constant of type ConstT.

GConstantBitsMatch

Matcher that binds raw bits from a G_CONSTANT or G_FCONSTANT.

GCstAndRegMatch

Matcher for an integer constant with look‐through, binding value and vreg.

GFCstAndRegMatch

Matcher for an FP constant with look‐through, binding value and vreg.

GFCstOrSplatGFCstMatch

Matcher for an FP constant or FP splat, binding value and defining vreg.

GFCstPredMatch

Matches an FP constant whose value satisfies the given predicate.

GFrameIndexMatch

Matcher that binds the frame index from a G_FRAME_INDEX.

GInstrBind

Binds the defining instruction of a register if it is a Class.

GIntrinsic_match

Matcher for a GIntrinsic with a fixed intrinsic ID and argument patterns.

ICstOrSplatMatch

Matcher for an integer constant or constant splat, binding the value.

ImplicitDefMatch

Matcher for a G_IMPLICIT_DEF defining instruction.

LoadOp_match

Matcher for a load of type Class with optional instruction/MMO binding.

MIFlagsRef

Optional trailing operand that binds a matched instruction's MI flags.

MMORef

Optional trailing operand that binds a load's MachineMemOperand.

OneNonDBGUse_match

Matcher that requires a register to have exactly one non‐debug use.

OneUse_match

Matcher that requires a register to have exactly one use.

Or

Empty Or combinator that never matches.

ShuffleVectorMatch

Matcher for G_SHUFFLE_VECTOR with source and mask bindings.

SpecificConstantMatch

Matcher for a specific constant value.

SpecificConstantOrSplatMatch

Matcher for a specific constant or constant splat.

SpecificConstantSplatMatch

Matcher for a specific constant splat.

SpecificImmMatch

Matcher for a specific immediate operand value.

SpecificRegisterMatch

Matcher for a specific register.

SrcImmOp_match

Matcher for an opcode with one source register and one immediate operand.

TernaryOp_match

Matcher for a ternary generic opcode with three operand sub‐patterns.

UnaryOp_match

Matcher for a unary generic opcode with one source sub‐pattern.

bind_helper

Helper that stores a matched value into an output reference.

bind_ty

Matcher that binds a matched value into an output reference.

deferred_helper

Helper that compares a previously bound value to a candidate.

deferred_ty

Matcher that compares against a value bound earlier in the expression.

operand_type_match

Matcher that accepts any register operand.

Functions

Name

Description

m_AllOnes

Matches an integer constant with all bits set.

m_AllOnesInt

Matches the integer constant with all bits set (64‐bit APInt form).

m_BinOp

Matches a binary opcode with the given operand sub‐patterns.

m_CommutativeBinOp

Matches a commutative binary opcode with the given operand sub‐patterns.

m_Copy

Matches a COPY of Src.

m_DeferredReg

Matches a register equal to a value bound earlier in the same expression.

m_DeferredType

Matches a type equal to a value bound earlier in the same expression.

m_FPClassTest

Binds the matched FP class test to T.

m_GAShr

Matches a G_ASHR (arithmetic right‐shift) with the given operand sub‐patterns.

m_GAdd

Matches a G_ADD with the given operand sub‐patterns.

m_GAddLike

Matches a G_ADD or a disjoint G_OR (add‐like forms).

m_GAnd

Matches a G_AND (bitwise and) with the given operand sub‐patterns.

m_GAnyExt

Matches a G_ANYEXT of Src.

m_GAnyLoad

m_GAnyLoad overloads

m_GAssertZext

m_GAssertZext overloads

m_GBitcast

Matches a G_BITCAST of Src.

m_GBuildVector

m_GBuildVector overloads

m_GBuildVectorTrunc

Matches a G_BUILD_VECTOR_TRUNC with two source sub‐patterns.

m_GConcatVectors

Binds a G_CONCAT_VECTORS defining instruction.

m_GConstant

m_GConstant overloads

m_GConstantOrFConstantBits

Matches a literal G_CONSTANT or G_FCONSTANT, binding raw bits to Bits.

m_GCst

Matches an integer constant with look‐through, binding value and vreg.

m_GDisjointOr

Matches a G_OR that is marked disjoint.

m_GFAdd

Matches a G_FADD (floating‐point add) with the given operand sub‐patterns.

m_GFCmp

Matches a G_FCMP with the given predicate and operand sub‐patterns.

m_GFCst

m_GFCst overloads

m_GFCstOrSplat

Matches an FP constant or FP splat, binding value and defining vreg.

m_GFFloor

Matches a G_FFLOOR of Src.

m_GFMul

Matches a G_FMUL (floating‐point multiply) with the given operand sub‐patterns.

m_GFNeg

Matches a G_FNEG of Src.

m_GFPExt

Matches a G_FPEXT of Src.

m_GFPTrunc

Matches a G_FPTRUNC of Src.

m_GFSqrt

Matches a G_FSQRT of Src.

m_GFSub

Matches a G_FSUB (floating‐point subtract) with the given operand sub‐patterns.

m_GFabs

Matches a G_FABS of Src.

m_GFrameIndex

Matches a G_FRAME_INDEX, binding its frame index to FI.

m_GICmp

Matches a G_ICMP with the given predicate and operand sub‐patterns.

m_GISelect

Matches a G_SELECT with the given condition and operand sub‐patterns.

m_GImplicitDef

Matches a G_IMPLICIT_DEF.

m_GInsertVecElt

Matches a G_INSERT_VECTOR_ELT with the given operand sub‐patterns.

m_GIntToPtr

Matches a G_INTTOPTR of Src.

m_GIntrinsic

m_GIntrinsic overloads

m_GIsFPClass

Matches a G_IS_FPCLASS test against a value and class mask.

m_GLShr

Matches a G_LSHR (logical right‐shift) with the given operand sub‐patterns.

m_GLoad

m_GLoad overloads

m_GMul

Matches a G_MUL (integer multiply) with the given operand sub‐patterns.

m_GOr

Matches a G_OR with the given operand sub‐patterns.

m_GPtrAdd

m_GPtrAdd overloads

m_GPtrToInt

Matches a G_PTRTOINT of Src.

m_GSExt

Matches a G_SEXT of Src.

m_GSExtInReg

m_GSExtInReg overloads

m_GSMax

Matches a G_SMAX (signed maximum) with the given operand sub‐patterns.

m_GSMin

Matches a G_SMIN (signed minimum) with the given operand sub‐patterns.

m_GShl

Matches a G_SHL (left‐shift) with the given operand sub‐patterns.

m_GShuffleVector

Matches a G_SHUFFLE_VECTOR, binding sources and mask.

m_GSub

m_GSub overloads

m_GTrunc

Matches a G_TRUNC of Src.

m_GUMax

Matches a G_UMAX (unsigned maximum) with the given operand sub‐patterns.

m_GUMin

Matches a G_UMIN (unsigned minimum) with the given operand sub‐patterns.

m_GUnmerge

Binds a G_UNMERGE_VALUES defining instruction.

m_GVScale

Binds a G_VSCALE defining instruction.

m_GXor

Matches a G_XOR (bitwise xor) with the given operand sub‐patterns.

m_GZExt

Matches a G_ZEXT of Src.

m_ICst

m_ICst overloads

m_ICstOrSplat

m_ICstOrSplat overloads

m_Imm

Binds an immediate operand's value to Imm.

m_MIFlags

Wrap Flags as an optional trailing instruction‐matcher operand.

m_MInstr

m_MInstr overloads

m_MMO

Wrap MMO as an optional trailing load‐matcher operand.

m_Neg

Matches a register negated by a G_SUB from zero.

m_Not

Matches a register bitwise‐not'ed by a G_XOR against all‐ones.

m_OneNonDBGUse

Matches SP only when the register has exactly one non‐debug use.

m_OneUse

Matches SP only when the register has exactly one use.

m_PosZeroFP

Matches a floating‐point positive zero.

m_Pred

m_Pred overloads

m_Reg

m_Reg overloads

m_SpecificICst

Matches a constant equal to RequestedValue.

m_SpecificICstOrSplat

Matches RequestedValue or a constant splat of that value.

m_SpecificICstSplat

Matches a constant splat of RequestedValue.

m_SpecificImm

Matches an immediate operand equal to RequestedValue.

m_SpecificReg

Matches a register only if it equals RequestedReg.

m_SpecificType

Matches a register whose LLT equals Ty.

m_Type

Binds the matched register's LLT to Ty.

m_ZeroInt

Convenience matchers for specific integer values.

m_all_of

Match only if every sub‐pattern in preds matches.

m_any_of

Match if any sub‐pattern in preds matches.

m_c_GFCmp

Matches a G_FCMP, including commuted operand order.

m_c_GICmp

Matches a G_ICMP, including commuted operand order.

matchConstant

matchConstant overloads

matchConstantSplat

matchConstantSplat overloads

mi_match

mi_match overloads

Created with MrDocs