15#ifndef LLVM_TRANSFORM_VECTORIZE_VPLANPATTERNMATCH_H
16#define LLVM_TRANSFORM_VECTORIZE_VPLANPATTERNMATCH_H
25template <
typename Val,
typename Pattern>
bool match(Val *V,
const Pattern &
P) {
57 template <
typename ITy>
bool match(ITy *V)
const {
98template <
typename Pred,
unsigned BitW
idth = 0>
struct int_pred_ty {
107 VPV = VPI->getOperand(0);
114 return P.isValue(CI->getAPInt());
131template <
unsigned Bitw
idth = 0>
188 Res = &CI->getAPInt();
201 const APInt *APConst;
240template <
typename Ops_t,
unsigned Opcode,
bool Commutative,
241 typename... RecipeTys>
246 static_assert(std::tuple_size<Ops_t>::value ==
sizeof...(Ops) &&
247 "number of operands in constructor doesn't match Ops_t");
248 static_assert((!Commutative || std::tuple_size<Ops_t>::value == 2) &&
249 "only binary ops can be commutative");
253 auto *DefR = V->getDefiningRecipe();
254 return DefR &&
match(DefR);
262 if (std::tuple_size_v<Ops_t> == 0) {
264 return VPI && VPI->getOpcode() == Opcode;
267 if ((!matchRecipeAndOpcode<RecipeTys>(R) && ...))
270 if (R->getNumOperands() < std::tuple_size<Ops_t>::value) {
274 (RepR && std::tuple_size_v<Ops_t> ==
275 RepR->getNumOperands() - RepR->isPredicated())) &&
276 "non-variadic recipe with matched opcode does not have the "
277 "expected number of operands");
284 if (R->getNumOperands() > std::tuple_size<Ops_t>::value) {
286 if (!VPI || !VPI->isMasked() ||
287 VPI->getNumOperandsWithoutMask() != std::tuple_size<Ops_t>::value)
291 auto IdxSeq = std::make_index_sequence<std::tuple_size<Ops_t>::value>();
292 if (all_of_tuple_elements(IdxSeq, [R](
auto Op,
unsigned Idx) {
293 return Op.match(R->getOperand(Idx));
297 return Commutative &&
298 all_of_tuple_elements(IdxSeq, [R](
auto Op,
unsigned Idx) {
299 return Op.match(R->getOperand(R->getNumOperands() - Idx - 1));
304 template <
typename RecipeTy>
305 static bool matchRecipeAndOpcode(
const VPRecipeBase *R) {
308 if constexpr (std::is_same_v<RecipeTy, VPScalarIVStepsRecipe> ||
309 std::is_same_v<RecipeTy, VPCanonicalIVPHIRecipe> ||
310 std::is_same_v<RecipeTy, VPDerivedIVRecipe> ||
311 std::is_same_v<RecipeTy, VPVectorEndPointerRecipe>)
314 return DefR && DefR->getOpcode() == Opcode;
319 template <
typename Fn, std::size_t... Is>
320 bool all_of_tuple_elements(std::index_sequence<Is...>, Fn
P)
const {
321 return (
P(std::get<Is>(
Ops), Is) && ...);
325template <
unsigned Opcode,
typename... OpTys>
331template <
unsigned Opcode,
typename... OpTys>
336template <
unsigned Opcode,
typename... OpTys>
340template <
unsigned Opcode,
typename... OpTys>
345template <
unsigned Opcode,
typename... OpTys>
351template <
unsigned Opcode,
typename Op0_t,
typename Op1_t>
363template <
typename Op0_t>
373template <
typename Op0_t>
384template <
typename Op0_t,
typename Op1_t>
390template <
typename Op0_t>
396template <
typename Op0_t>
402template <
typename Op0_t>
408template <
typename Op0_t,
typename Op1_t>
414template <
typename Op0_t,
typename Op1_t>
420template <
typename Op0_t>
426template <
typename Op0_t>
434template <
typename Op0_t>
440template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
450template <
typename Op0_t,
typename Op1_t>
460template <
typename Op0_t>
466template <
typename Op0_t>
472template <
typename Op0_t>
478template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
485template <
typename Op0_t>
494template <
typename Op0_t,
typename Op1_t>
502template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
509template <
typename Op0_t>
519template <
typename Op0_t>
525template <
unsigned Opcode,
typename Op0_t>
530template <
typename Op0_t>
535template <
typename Op0_t>
541template <
typename Op0_t>
546template <
typename Op0_t>
551template <
typename Op0_t>
556template <
typename Op0_t>
567template <
typename Op0_t>
577template <
unsigned Opcode,
typename Op0_t,
typename Op1_t>
583template <
unsigned Opcode,
typename Op0_t,
typename Op1_t>
589template <
typename Op0_t,
typename Op1_t>
595template <
typename Op0_t,
typename Op1_t>
601template <
typename Op0_t,
typename Op1_t>
607template <
typename Op0_t,
typename Op1_t>
613template <
typename Op0_t,
typename Op1_t>
619template <
typename Op0_t,
typename Op1_t>
625template <
typename Op0_t,
typename Op1_t>
631template <
typename Op0_t,
typename Op1_t>
637template <
typename Op0_t,
typename Op1_t>
644template <
typename Op0_t,
typename Op1_t>
654template <
typename Op0_t,
typename Op1_t>
660template <
typename Op0_t,
typename Op1_t>
669template <
typename Op0_t,
typename Op1_t,
unsigned... Opcodes>
671 static_assert((
sizeof...(Opcodes) == 1 ||
sizeof...(Opcodes) == 2) &&
672 "Expected one or two opcodes");
674 ((Opcodes == Instruction::ICmp || Opcodes == Instruction::FCmp) && ...) &&
675 "Expected a compare instruction opcode");
686 auto *DefR = V->getDefiningRecipe();
687 return DefR &&
match(DefR);
702template <
typename Op0_t,
typename Op1_t,
unsigned... Opcodes>
712 auto *DefR = V->getDefiningRecipe();
713 return DefR &&
match(DefR);
724template <
typename Op0_t,
typename Op1_t>
730template <
typename Op0_t,
typename Op1_t>
731inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp>
736template <
typename Op0_t,
typename Op1_t>
737inline SpecificCmp_match<Op0_t, Op1_t, Instruction::ICmp>
743template <
typename Op0_t,
typename Op1_t>
744inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
750template <
typename Op0_t,
typename Op1_t>
751inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
757template <
typename Op0_t,
typename Op1_t>
758inline SpecificCmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
761 MatchPred, Op0, Op1);
764template <
typename Op0_t,
typename Op1_t>
767 Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
774template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
781template <
typename Op0_t>
inline auto m_Not(
const Op0_t &Op0) {
786template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
791template <
typename Op0_t,
typename Op1_t>
798template <
typename Op0_t,
typename Op1_t>
805template <
typename Op0_t,
typename Op1_t>
812template <
typename Op0_t,
typename Op1_t>
819template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
826template <
typename Op0_t,
typename Op1_t,
typename Op2_t>
832template <
typename Addr_t,
typename Mask_t>
struct Load_match {
838 template <
typename OpTy>
bool match(
const OpTy *V)
const {
840 if (!Load || !
Addr.match(Load->getAddr()) || !Load->isMasked() ||
841 !
Mask.match(Load->getMask()))
848template <
typename Addr_t,
typename Mask_t>
850 const Mask_t &Mask) {
854template <
typename Addr_t,
typename Val_t,
typename Mask_t>
struct Store_match {
862 template <
typename OpTy>
bool match(
const OpTy *V)
const {
864 if (!Store || !
Addr.match(Store->getAddr()) ||
865 !
Val.match(Store->getStoredValue()) || !Store->isMasked() ||
866 !
Mask.match(Store->getMask()))
873template <
typename Addr_t,
typename Val_t,
typename Mask_t>
874inline Store_match<Addr_t, Val_t, Mask_t>
879template <
typename Op0_t,
typename Op1_t>
884template <
typename Op0_t,
typename Op1_t>
898 template <
typename OpTy>
bool match(OpTy *V)
const {
900 return Val.match(R->getOperand(
OpI));
902 return Val.match(R->getOperand(
OpI));
904 if (R->getOpcode() == Instruction::Call)
905 return Val.match(R->getOperand(
OpI));
907 if (R->getOpcode() == Instruction::Call)
908 return Val.match(R->getOperand(
OpI));
914template <
unsigned OpI,
typename Opnd_t>
925 template <
typename OpTy>
bool match(OpTy *V)
const {
927 return R->getVectorIntrinsicID() ==
ID;
929 return R->getCalledScalarFunction()->getIntrinsicID() ==
ID;
931 auto MatchCalleeIntrinsic = [&](
VPValue *CalleeOp) {
935 return F->getIntrinsicID() ==
ID;
938 if (R->getOpcode() == Instruction::Call) {
940 return MatchCalleeIntrinsic(
941 R->getOperand(R->getNumOperands() - 1 - R->isPredicated()));
944 if (R->getOpcode() == Instruction::Call)
945 return MatchCalleeIntrinsic(R->getOperand(R->getNumOperands() - 1));
954template <
typename T0 = void,
typename T1 = void,
typename T2 = void,
964template <
typename T0,
typename T1,
typename T2>
969template <
typename T0,
typename T1,
typename T2,
typename T3>
986template <Intrinsic::ID IntrID,
typename T0>
991template <Intrinsic::ID IntrID,
typename T0,
typename T1>
997template <Intrinsic::ID IntrID,
typename T0,
typename T1,
typename T2>
1003template <
Intrinsic::ID IntrID,
typename T0,
typename T1,
typename T2,
1006m_Intrinsic(
const T0 &Op0,
const T1 &Op1,
const T2 &Op2,
const T3 &Op3) {
1021 template <
typename ITy>
bool match(ITy *V)
const {
1022 return matchRecipeAndBind<VPWidenGEPRecipe>(V) ||
1023 matchRecipeAndBind<VPInstruction>(V) ||
1024 matchRecipeAndBind<VPReplicateRecipe>(V);
1028 template <
typename RecipeTy>
bool matchRecipeAndBind(
const VPValue *V)
const {
1033 if constexpr (std::is_same_v<RecipeTy, VPWidenGEPRecipe>) {
1035 }
else if (DefR->getOpcode() == Instruction::GetElementPtr) {
1037 ->getSourceElementType();
1038 }
else if constexpr (std::is_same_v<RecipeTy, VPInstruction>) {
1041 LLVMContext &Ctx = DefR->getParent()->getPlan()->getContext();
1067 template <
typename OpTy>
bool match(OpTy *V) {
1068 return V->hasOneUse() &&
SubPattern.match(V);
1080template <
typename Op0_t,
typename Op1_t>
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
MachineInstr unsigned OpIdx
This file contains the declarations of the Vectorization Plan base classes:
Class for arbitrary precision integers.
std::optional< uint64_t > tryZExtValue() const
Get zero extended value if possible.
static bool isSameValue(const APInt &I1, const APInt &I2, bool SignedCompare=false)
Determine if two APInts have the same value, after zero-extending or sign-extending (if SignedCompare...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An abstraction over a floating-point predicate, and a pack of an integer predicate with samesign info...
static LLVM_ABI std::optional< CmpPredicate > getMatching(CmpPredicate A, CmpPredicate B)
Compares two CmpPredicates taking samesign into account and returns the canonicalized CmpPredicate if...
This is an important class for using LLVM in a threaded context.
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
A recipe for converting the input value IV value to the corresponding value of an IV with different s...
This is a concrete Recipe that models a single VPlan-level instruction.
@ ExtractLastActive
Extracts the last active lane from a set of vectors.
@ ComputeAnyOfResult
Compute the final result of a AnyOf reduction with select(cmp(),x,y), where one of (x,...
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
A recipe for handling reduction phis.
VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original sca...
A recipe for handling phi nodes of integer and floating-point inductions, producing their scalar valu...
VPSingleDef is a base class for recipes for modeling a sequence of one or more output IR that define ...
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
This is the base class of the VPlan Def/Use graph, used for modeling the data flow into,...
A recipe to compute a pointer to the last element of each part of a widened memory access for widened...
VPWidenCastRecipe is a recipe to create vector cast instructions.
A recipe for handling GEP instructions.
VPWidenRecipe is a recipe for producing a widened instruction using the opcode and operands of the re...
@ C
The default llvm calling convention, compatible with C.
match_isa< To... > m_Isa()
match_combine_or< Ty... > m_CombineOr(const Ty &...Ps)
Combine pattern matchers matching any of Ps patterns.
match_combine_and< Ty... > m_CombineAnd(const Ty &...Ps)
Combine pattern matchers matching all of Ps patterns.
auto m_Cmp()
Matches any compare instruction and ignore it.
auto m_LogicalOr()
Matches L || R where L and R are arbitrary values.
auto m_LogicalAnd()
Matches L && R where L and R are arbitrary values.
auto m_ConstantInt()
Match an arbitrary ConstantInt and ignore it.
VPInstruction_match< VPInstruction::ExtractLastLane, VPInstruction_match< VPInstruction::ExtractLastPart, Op0_t > > m_ExtractLastLaneOfLastPart(const Op0_t &Op0)
AllRecipe_match< Instruction::Select, Op0_t, Op1_t, Op2_t > m_Select(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
VPInstruction_match< Instruction::Freeze, Op0_t > m_Freeze(const Op0_t &Op0)
AllRecipe_commutative_match< Instruction::And, Op0_t, Op1_t > m_c_BinaryAnd(const Op0_t &Op0, const Op1_t &Op1)
Match a binary AND operation.
AllRecipe_match< Instruction::ZExt, Op0_t > m_ZExt(const Op0_t &Op0)
AllRecipe_match< Instruction::Or, Op0_t, Op1_t > m_BinaryOr(const Op0_t &Op0, const Op1_t &Op1)
Match a binary OR operation.
int_pred_ty< is_specific_int, Bitwidth > specific_intval
Store_match< Addr_t, Val_t, Mask_t > m_MaskedStore(const Addr_t &Addr, const Val_t &Val, const Mask_t &Mask)
Match a (possibly reversed) masked store.
int_pred_ty< is_zero_int > m_ZeroInt()
Match an integer 0 or a vector with all elements equal to 0.
AllRecipe_match< Instruction::FMul, Op0_t, Op1_t > m_FMul(const Op0_t &Op0, const Op1_t &Op1)
SpecificCmp_match< Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp > m_SpecificCmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1)
VPInstruction_match< VPInstruction::AnyOf > m_AnyOf()
int_pred_ty< is_all_ones > m_AllOnes()
Match an integer or vector with all bits set.
AllRecipe_commutative_match< Opcode, Op0_t, Op1_t > m_c_Binary(const Op0_t &Op0, const Op1_t &Op1)
AllRecipe_commutative_match< Instruction::Add, Op0_t, Op1_t > m_c_Add(const Op0_t &Op0, const Op1_t &Op1)
AllRecipe_commutative_match< Instruction::Or, Op0_t, Op1_t > m_c_BinaryOr(const Op0_t &Op0, const Op1_t &Op1)
bool matchFindIVResult(VPInstruction *VPI, Op0_t ReducedIV, Op1_t Start)
Match FindIV result pattern: select(icmp ne ComputeReductionResult(ReducedIV), Sentinel),...
VPInstruction_match< VPInstruction::ComputeReductionResult, Op0_t > m_ComputeReductionResult(const Op0_t &Op0)
auto m_WidenAnyExtend(const Op0_t &Op0)
VPInstruction_match< VPInstruction::StepVector > m_StepVector()
auto m_c_LogicalOr(const Op0_t &Op0, const Op1_t &Op1)
match_combine_or< AllRecipe_match< Instruction::ZExt, Op0_t >, AllRecipe_match< Instruction::SExt, Op0_t > > m_ZExtOrSExt(const Op0_t &Op0)
auto m_VPPhi(const Op0_t &Op0, const Op1_t &Op1)
SpecificCmp_match< Op0_t, Op1_t, Instruction::ICmp > m_SpecificICmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1)
AllRecipe_match< Instruction::Add, Op0_t, Op1_t > m_Add(const Op0_t &Op0, const Op1_t &Op1)
match_poison m_Poison()
Match a VPIRValue that's poison.
bind_ty< VPSingleDefRecipe > m_VPSingleDefRecipe(VPSingleDefRecipe *&V)
Match a VPSingleDefRecipe, capturing if we match.
auto m_c_Select(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
Recipe_match< std::tuple< OpTys... >, Opcode, false, VPInstruction > VPInstruction_match
VPInstruction_match< VPInstruction::BranchOnTwoConds > m_BranchOnTwoConds()
AllRecipe_match< Opcode, Op0_t, Op1_t > m_Binary(const Op0_t &Op0, const Op1_t &Op1)
bind_ty< VPReductionPHIRecipe > m_ReductionPhi(VPReductionPHIRecipe *&V)
auto match_fn(const Pattern &P)
A match functor that can be used as a UnaryPredicate in functional algorithms like all_of.
VPInstruction_match< VPInstruction::LastActiveLane, Op0_t > m_LastActiveLane(const Op0_t &Op0)
AllRecipe_match< Opcode, Op0_t > m_Unary(const Op0_t &Op0)
Recipe_match< std::tuple< OpTys... >, Opcode, true, VPInstruction > VPInstruction_commutative_match
AllRecipe_commutative_match< Instruction::FAdd, Op0_t, Op1_t > m_c_FAdd(const Op0_t &Op0, const Op1_t &Op1)
Load_match< Addr_t, Mask_t > m_MaskedLoad(const Addr_t &Addr, const Mask_t &Mask)
Match a (possibly reversed) masked load.
VPInstruction_match< VPInstruction::ExtractLastActive, Op0_t, Op1_t, Op2_t > m_ExtractLastActive(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
match_combine_or< AllRecipe_match< Instruction::Trunc, Op0_t >, Op0_t > m_TruncOrSelf(const Op0_t &Op0)
AllRecipe_match< Instruction::FPExt, Op0_t > m_FPExt(const Op0_t &Op0)
AllRecipe_commutative_match< Instruction::Mul, Op0_t, Op1_t > m_c_Mul(const Op0_t &Op0, const Op1_t &Op1)
Cmp_match< Op0_t, Op1_t, Instruction::ICmp > m_ICmp(const Op0_t &Op0, const Op1_t &Op1)
AllRecipe_match< Instruction::Mul, Op0_t, Op1_t > m_Mul(const Op0_t &Op0, const Op1_t &Op1)
specificval_ty m_Specific(const VPValue *VPV)
VPInstruction_match< VPInstruction::ExitingIVValue, Op0_t > m_ExitingIVValue(const Op0_t &Op0)
VPInstruction_match< Instruction::ExtractElement, Op0_t, Op1_t > m_ExtractElement(const Op0_t &Op0, const Op1_t &Op1)
specific_intval< 1 > m_False()
VPInstruction_match< VPInstruction::ExtractLastLane, Op0_t > m_ExtractLastLane(const Op0_t &Op0)
specific_intval< 0 > m_SpecificInt(uint64_t V)
VPInstruction_match< VPInstruction::ActiveLaneMask, Op0_t, Op1_t, Op2_t > m_ActiveLaneMask(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
VPInstruction_match< VPInstruction::BranchOnCount > m_BranchOnCount()
bind_ty< VPIRValue > m_VPIRValue(VPIRValue *&V)
Match a VPIRValue.
auto m_GetElementPtr(const Op0_t &Op0, const Op1_t &Op1)
auto m_ZExtOrTruncOrSelf(const Op0_t &Op0)
AllRecipe_match< Instruction::Sub, Op0_t, Op1_t > m_Sub(const Op0_t &Op0, const Op1_t &Op1)
AllRecipe_match< Instruction::SExt, Op0_t > m_SExt(const Op0_t &Op0)
VPInstruction_commutative_match< Opcode, Op0_t, Op1_t > m_c_VPInstruction(const Op0_t &Op0, const Op1_t &Op1)
specific_intval< 1 > m_True()
auto m_VPValue()
Match an arbitrary VPValue and ignore it.
IntrinsicID_match m_Intrinsic()
Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_VPValue(X), ...)
Recipe_match< std::tuple< OpTys... >, Opcode, true, VPWidenRecipe, VPReplicateRecipe, VPInstruction > AllRecipe_commutative_match
specific_intval< 0 > m_SpecificSInt(int64_t V)
AllRecipe_match< Instruction::FAdd, Op0_t, Op1_t > m_FAdd(const Op0_t &Op0, const Op1_t &Op1)
deferredval_ty m_Deferred(VPValue *const &V)
Like m_Specific(), but works if the specific value to match is determined as part of the same match()...
VectorEndPointerRecipe_match< Op0_t, Op1_t > m_VecEndPtr(const Op0_t &Op0, const Op1_t &Op1)
VPInstruction_match< VPInstruction::ExtractLastPart, Op0_t > m_ExtractLastPart(const Op0_t &Op0)
VPInstruction_match< VPInstruction::Broadcast, Op0_t > m_Broadcast(const Op0_t &Op0)
bool match(Val *V, const Pattern &P)
OneUse_match< T > m_OneUse(const T &SubPattern)
VPInstruction_match< VPInstruction::ExplicitVectorLength, Op0_t > m_EVL(const Op0_t &Op0)
VPInstruction_match< VPInstruction::BuildVector > m_BuildVector()
BuildVector is matches only its opcode, w/o matching its operands as the number of operands is not fi...
AllRecipe_match< Instruction::Trunc, Op0_t > m_Trunc(const Op0_t &Op0)
VPInstruction_match< VPInstruction::ExtractPenultimateElement, Op0_t > m_ExtractPenultimateElement(const Op0_t &Op0)
Recipe_match< std::tuple< Op0_t, Op1_t >, 0, false, VPVectorEndPointerRecipe > VectorEndPointerRecipe_match
match_combine_or< AllRecipe_match< Instruction::ZExt, Op0_t >, Op0_t > m_ZExtOrSelf(const Op0_t &Op0)
VPInstruction_match< VPInstruction::FirstActiveLane, Op0_t > m_FirstActiveLane(const Op0_t &Op0)
Argument_match< Opnd_t > m_Argument(const Opnd_t &Op)
Match a call argument.
bind_ty< VPInstruction > m_VPInstruction(VPInstruction *&V)
Match a VPInstruction, capturing if we match.
VPInstruction_match< VPInstruction::ComputeAnyOfResult, Op0_t, Op1_t, Op2_t > m_ComputeAnyOfResult(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
AllRecipe_match< Instruction::UDiv, Op0_t, Op1_t > m_UDiv(const Op0_t &Op0, const Op1_t &Op1)
auto m_Not(const Op0_t &Op0)
auto m_DerivedIV(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
auto m_c_LogicalAnd(const Op0_t &Op0, const Op1_t &Op1)
int_pred_ty< is_one > m_One()
Match an integer 1 or a vector with all elements equal to 1.
Recipe_match< std::tuple< OpTys... >, Opcode, false, VPWidenRecipe, VPReplicateRecipe, VPWidenCastRecipe, VPInstruction > AllRecipe_match
VPInstruction_match< VPInstruction::BranchOnCond > m_BranchOnCond()
auto m_ScalarIVSteps(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
VPInstruction_match< VPInstruction::ExtractLane, Op0_t, Op1_t > m_ExtractLane(const Op0_t &Op0, const Op1_t &Op1)
bind_apint m_APInt(const APInt *&C)
VPInstruction_match< VPInstruction::Reverse, Op0_t > m_Reverse(const Op0_t &Op0)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
constexpr auto bind_back(FnT &&Fn, BindArgsT &&...BindArgs)
C++23 bind_back.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Implement std::hash so that hash_code can be used in STL containers.
Matching and combinator leaf case.
Matching or combinator leaf case.
Intrinsic matches are combinations of ID matchers, and argument matchers.
A VPValue representing a live-in from the input IR or a constant.
Match a call argument at a given argument index.
unsigned OpI
Call argument index to match.
Argument_match(unsigned OpIdx, const Opnd_t &V)
bool match(OpTy *V) const
Cmp_match is a variant of BinaryRecipe_match that also binds the comparison predicate.
Cmp_match(CmpPredicate &Pred, const Op0_t &Op0, const Op1_t &Op1)
Cmp_match(const Op0_t &Op0, const Op1_t &Op1)
bool match(const VPValue *V) const
bool match(const VPRecipeBase *V) const
Match a GEP recipe (VPWidenGEPRecipe, VPInstruction, or VPReplicateRecipe) and bind the source elemen...
GetElementPtr_match(Type *&SourceElementType, ArrayRef< VPValue * > &Operands)
ArrayRef< VPValue * > & Operands
Type *& SourceElementType
IntrinsicID_match(Intrinsic::ID IntrID)
bool match(OpTy *V) const
Load_match(Addr_t Addr, Mask_t Mask)
bool match(const OpTy *V) const
OneUse_match(const SubPattern_t &SP)
bool match(const VPSingleDefRecipe *R) const
Recipe_match(OpTy... Ops)
std::tuple< OpTys... > Ops
bool match(const VPValue *V) const
bool match(const VPRecipeBase *R) const
SpecificCmp_match is a variant of Cmp_match that matches the comparison predicate,...
SpecificCmp_match(CmpPredicate Pred, const Op0_t &LHS, const Op1_t &RHS)
const CmpPredicate Predicate
bool match(const VPValue *V) const
bool match(const VPRecipeBase *V) const
Store_match(Addr_t Addr, Val_t Val, Mask_t Mask)
bool match(const OpTy *V) const
bind_apint(const APInt *&Res)
bool match(const VPValue *VPV) const
bool match(const VPValue *VPV) const
bind_const_int(uint64_t &Res)
Stores a reference to the VPValue *, not the VPValue * itself, thus can be used in commutative matche...
deferredval_ty(VPValue *const &V)
bool match(const VPValue *const V) const
Match an integer constant if Pred::isValue returns true for the APInt.
bool match(const VPValue *VPV) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
Match a specified signed or unsigned integer value.
bool isValue(const APInt &C) const
is_specific_int(APInt Val, bool IsSigned=false)
bool isValue(const APInt &C) const
match_combine_and< typename m_Intrinsic_Ty< T0, T1 >::Ty, Argument_match< T2 > > Ty
match_combine_and< typename m_Intrinsic_Ty< T0 >::Ty, Argument_match< T1 > > Ty
match_combine_and< IntrinsicID_match, Argument_match< T0 > > Ty
Intrinsic matches are combinations of ID matchers, and argument matchers.
match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2 >::Ty, Argument_match< T3 > > Ty
bool match(const VPValue *V) const
Match a specified VPValue.
specificval_ty(const VPValue *V)
bool match(const VPValue *VPV) const