LLVM: lib/Transforms/Vectorize/VPlanPatternMatch.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_TRANSFORM_VECTORIZE_VPLANPATTERNMATCH_H
16#define LLVM_TRANSFORM_VECTORIZE_VPLANPATTERNMATCH_H
17
19
21
22template <typename Val, typename Pattern> bool match(Val *V, const Pattern &P) {
23 return P.match(V);
24}
25
29}
30
34
40
41
42
43template
47
51
52
54
57
59
60 template bool match(ITy *V) const {
62 VR = CV;
63 return true;
64 }
65 return false;
66 }
67};
68
69
77
79
80
81
89
90
91
92
93
94
95
97
98
99
100
101
102template <typename Pred, unsigned BitWidth = 0> struct int_pred_ty {
104
107
110 return false;
112 if (!V)
113 return false;
114 assert(!V->getType()->isVectorTy() && "Unexpected vector live-in");
116 if (!CI)
117 return false;
118
120 return false;
121 return P.isValue(CI->getValue());
122 }
123};
124
125
126
127
135
136template
138
142
146
150
154
155
156
160
164
168
169
170
174
175
176
178
181
183
186 return false;
188 if (!V)
189 return false;
190 assert(!V->getType()->isVectorTy() && "Unexpected vector live-in");
192 if (!CI)
193 return false;
194 Res = &CI->getValue();
195 return true;
196 }
197};
198
200
203
205
207 const APInt *APConst;
209 return false;
212 return true;
213 }
214 return false;
215 }
216};
217
218
219
221
222
226
228
229 template bool match(ITy *V) const {
230 return L.match(V) || R.match(V);
231 }
232};
233
237
239
240 template bool match(ITy *V) const {
241 return L.match(V) && R.match(V);
242 }
243};
244
245
246template <typename LTy, typename RTy>
250
251
252template <typename LTy, typename RTy>
256
257
259
260
262
263template <typename Ops_t, unsigned Opcode, bool Commutative,
264 typename... RecipeTys>
267
269 static_assert(std::tuple_size<Ops_t>::value == sizeof...(Ops) &&
270 "number of operands in constructor doesn't match Ops_t");
271 static_assert((!Commutative || std::tuple_size<Ops_t>::value == 2) &&
272 "only binary ops can be commutative");
273 }
274
276 auto *DefR = V->getDefiningRecipe();
277 return DefR && match(DefR);
278 }
279
283
285 if (std::tuple_size_v<Ops_t> == 0) {
287 return VPI && VPI->getOpcode() == Opcode;
288 }
289
290 if ((!matchRecipeAndOpcode(R) && ...))
291 return false;
292
293 if (R->getNumOperands() != std::tuple_size<Ops_t>::value) {
294 assert(Opcode == Instruction::PHI &&
295 "non-variadic recipe with matched opcode does not have the "
296 "expected number of operands");
297 return false;
298 }
299
300 auto IdxSeq = std::make_index_sequence<std::tuple_size<Ops_t>::value>();
301 if (all_of_tuple_elements(IdxSeq, [R](auto Op, unsigned Idx) {
302 return Op.match(R->getOperand(Idx));
303 }))
304 return true;
305
306 return Commutative &&
307 all_of_tuple_elements(IdxSeq, [R](auto Op, unsigned Idx) {
308 return Op.match(R->getOperand(R->getNumOperands() - Idx - 1));
309 });
310 }
311
312private:
313 template
314 static bool matchRecipeAndOpcode(const VPRecipeBase *R) {
316
317 if constexpr (std::is_same_v<RecipeTy, VPScalarIVStepsRecipe> ||
318 std::is_same_v<RecipeTy, VPCanonicalIVPHIRecipe> ||
319 std::is_same_v<RecipeTy, VPDerivedIVRecipe> ||
320 std::is_same_v<RecipeTy, VPVectorEndPointerRecipe>)
321 return DefR;
322 else
323 return DefR && DefR->getOpcode() == Opcode;
324 }
325
326
327
328 template <typename Fn, std::size_t... Is>
329 bool all_of_tuple_elements(std::index_sequence<Is...>, Fn P) const {
330 return (P(std::get(Ops), Is) && ...);
331 }
332};
333
334template <unsigned Opcode, typename... OpTys>
336 Recipe_match<std::tuple<OpTys...>, Opcode, false,
339
340template <unsigned Opcode, typename... OpTys>
342 Recipe_match<std::tuple<OpTys...>, Opcode, true,
344
345template <unsigned Opcode, typename... OpTys>
348
349template <unsigned Opcode, typename... OpTys>
354
355
356
360
361template <typename Op0_t>
366
370
371template <typename Op0_t>
376
377template <typename Op0_t>
382
383template <typename Op0_t>
388
389template <typename Op0_t>
394
395template <typename Op0_t, typename Op1_t>
400
401template <typename Op0_t, typename Op1_t>
406
407template <typename Op0_t>
412
413template <typename Op0_t>
420
421template <typename Op0_t>
426
427template <typename Op0_t, typename Op1_t, typename Op2_t>
432
436
437template <typename Op0_t, typename Op1_t>
442
446
447template <typename Op0_t>
452
453template <typename Op0_t>
458
459template <typename Op0_t>
464
468
469template <unsigned Opcode, typename Op0_t>
473
474template <typename Op0_t>
478
479template <typename Op0_t>
484
485template <typename Op0_t>
489
490template <typename Op0_t>
494
495template <typename Op0_t>
501
502template <typename Op0_t>
507
508template <unsigned Opcode, typename Op0_t, typename Op1_t>
510 const Op1_t &Op1) {
512}
513
514template <unsigned Opcode, typename Op0_t, typename Op1_t>
519
520template <typename Op0_t, typename Op1_t>
522 const Op1_t &Op1) {
524}
525
526template <typename Op0_t, typename Op1_t>
531
532template <typename Op0_t, typename Op1_t>
534 const Op1_t &Op1) {
536}
537
538template <typename Op0_t, typename Op1_t>
540 const Op1_t &Op1) {
542}
543
544template <typename Op0_t, typename Op1_t>
549
550
551template <typename Op0_t, typename Op1_t>
556
557
558
559
560
561template <typename Op0_t, typename Op1_t>
566
567template <typename Op0_t, typename Op1_t>
572
573
574
575
576template <typename Op0_t, typename Op1_t, unsigned... Opcodes>
578 static_assert((sizeof...(Opcodes) == 1 || sizeof...(Opcodes) == 2) &&
579 "Expected one or two opcodes");
580 static_assert(
581 ((Opcodes == Instruction::ICmp || Opcodes == Instruction::FCmp) && ...) &&
582 "Expected a compare instruction opcode");
583
587
591
593 auto *DefR = V->getDefiningRecipe();
594 return DefR && match(DefR);
595 }
596
601 return true;
602 }
603 return false;
604 }
605};
606
607
608
609template <typename Op0_t, typename Op1_t, unsigned... Opcodes>
625
626template <typename Op0_t, typename Op1_t>
628 const Op1_t &Op1) {
630}
631
632template <typename Op0_t, typename Op1_t>
633inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp>
637
638template <typename Op0_t, typename Op1_t>
639inline SpecificCmp_match<Op0_t, Op1_t, Instruction::ICmp>
644
645template <typename Op0_t, typename Op1_t>
646inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
651
652template <typename Op0_t, typename Op1_t>
653inline Cmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
656 Pred, Op0, Op1);
657}
658
659template <typename Op0_t, typename Op1_t>
660inline SpecificCmp_match<Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp>
663 MatchPred, Op0, Op1);
664}
665
666template <typename Op0_t, typename Op1_t>
673
674template <typename Op0_t, typename Op1_t>
676 const Op1_t &Op1) {
678 Recipe_match<std::tuple<Op0_t, Op1_t>, Instruction::GetElementPtr,
680 Op0, Op1),
684 Op1)));
685}
686
687template <typename Op0_t, typename Op1_t, typename Op2_t>
689m_Select(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2) {
691 {Op0, Op1, Op2});
692}
693
694template <typename Op0_t>
697 Instruction::Xor, int_pred_ty<is_all_ones>, Op0_t>>
702
703template <typename Op0_t, typename Op1_t>
712
713template <typename Op0_t, typename Op1_t>
718
719template <typename Op0_t, typename Op1_t, typename Op2_t>
722
723template <typename Op0_t, typename Op1_t, typename Op2_t>
728
729template <typename Op0_t, typename Op1_t, typename Op2_t>
732
733template <typename Op0_t, typename Op1_t, typename Op2_t>
738
739template <typename Addr_t, typename Mask_t> struct Load_match {
742
744
745 template bool match(const OpTy *V) const {
747 if (!Load || .match(Load->getAddr()) || !Load->isMasked() ||
748 .match(Load->getMask()))
749 return false;
750 return true;
751 }
752};
753
754
755template <typename Addr_t, typename Mask_t>
757 const Mask_t &Mask) {
759}
760
761template <typename Addr_t, typename Val_t, typename Mask_t> struct Store_match {
765
768
769 template bool match(const OpTy *V) const {
771 if (!Store || .match(Store->getAddr()) ||
772 .match(Store->getStoredValue()) || !Store->isMasked() ||
773 .match(Store->getMask()))
774 return false;
775 return true;
776 }
777};
778
779
780template <typename Addr_t, typename Val_t, typename Mask_t>
781inline Store_match<Addr_t, Val_t, Mask_t>
782m_MaskedStore(const Addr_t &Addr, const Val_t &Val, const Mask_t &Mask) {
784}
785
786template <typename Op0_t, typename Op1_t>
790
791template <typename Op0_t, typename Op1_t>
793 const Op1_t &Op1) {
795}
796
797
799
802
804
805 template bool match(OpTy *V) const {
807 return Val.match(R->getOperand(OpI));
809 return Val.match(R->getOperand(OpI));
812 return Val.match(R->getOperand(OpI + 1));
813 return false;
814 }
815};
816
817
818template <unsigned OpI, typename Opnd_t>
822
823
826
828
829 template bool match(OpTy *V) const {
831 return R->getVectorIntrinsicID() == ID;
833 return R->getCalledScalarFunction()->getIntrinsicID() == ID;
836 if (const auto *F = CI->getCalledFunction())
837 return F->getIntrinsicID() == ID;
838 return false;
839 }
840};
841
842
843
844
845
846template <typename T0 = void, typename T1 = void, typename T2 = void,
847 typename T3 = void>
856template <typename T0, typename T1, typename T2>
861template <typename T0, typename T1, typename T2, typename T3>
866
867
868
872
873
877
878template <Intrinsic::ID IntrID, typename T0>
882
883template <Intrinsic::ID IntrID, typename T0, typename T1>
885 const T1 &Op1) {
887}
888
889template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2>
894
895template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2,
896 typename T3>
898m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3) {
900}
901
903 template bool match(ITy *V) const {
905 return Val && Val->isLiveIn();
906 }
907};
908
910
913
915
916 template bool match(OpTy *V) {
917 return V->hasOneUse() && SubPattern.match(V);
918 }
919};
920
922 return SubPattern;
923}
924
925}
926
927#endif
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)
Determine if two APInts have the same value, after zero-extending one of them (if needed!...
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...
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.
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
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,...
Value * getLiveInIRValue() const
Returns the underlying IR value, if this VPValue is defined outside the scope of VPlan.
bool isLiveIn() const
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
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...
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
class_match< ConstantInt > m_ConstantInt()
Match an arbitrary ConstantInt and ignore it.
auto m_LogicalOr()
Matches L || R where L and R are arbitrary values.
class_match< CmpInst > m_Cmp()
Matches any compare instruction and ignore it.
auto m_LogicalAnd()
Matches L && R where L and R are arbitrary values.
Definition VPlanPatternMatch.h:20
VPInstruction_match< VPInstruction::ExtractLastLane, VPInstruction_match< VPInstruction::ExtractLastPart, Op0_t > > m_ExtractLastLaneOfLastPart(const Op0_t &Op0)
Definition VPlanPatternMatch.h:417
AllRecipe_match< Instruction::Select, Op0_t, Op1_t, Op2_t > m_Select(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
Definition VPlanPatternMatch.h:689
VPInstruction_match< Instruction::Freeze, Op0_t > m_Freeze(const Op0_t &Op0)
Definition VPlanPatternMatch.h:363
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.
Definition VPlanPatternMatch.h:553
AllRecipe_match< Instruction::ZExt, Op0_t > m_ZExt(const Op0_t &Op0)
Definition VPlanPatternMatch.h:486
AllRecipe_match< Instruction::Or, Op0_t, Op1_t > m_BinaryOr(const Op0_t &Op0, const Op1_t &Op1)
Match a binary OR operation.
Definition VPlanPatternMatch.h:563
int_pred_ty< is_specific_int, Bitwidth > specific_intval
Definition VPlanPatternMatch.h:137
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.
Definition VPlanPatternMatch.h:782
int_pred_ty< is_zero_int > m_ZeroInt()
Match an integer 0 or a vector with all elements equal to 0.
Definition VPlanPatternMatch.h:171
SpecificCmp_match< Op0_t, Op1_t, Instruction::ICmp, Instruction::FCmp > m_SpecificCmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:661
match_combine_or< VPInstruction_match< VPInstruction::Not, Op0_t >, AllRecipe_commutative_match< Instruction::Xor, int_pred_ty< is_all_ones >, Op0_t > > m_Not(const Op0_t &Op0)
Definition VPlanPatternMatch.h:698
VPInstruction_match< VPInstruction::AnyOf > m_AnyOf()
Definition VPlanPatternMatch.h:443
int_pred_ty< is_all_ones > m_AllOnes()
Match an integer or vector with all bits set.
Definition VPlanPatternMatch.h:157
AllRecipe_commutative_match< Opcode, Op0_t, Op1_t > m_c_Binary(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:516
AllRecipe_commutative_match< Instruction::Add, Op0_t, Op1_t > m_c_Add(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:528
AllRecipe_commutative_match< Instruction::Or, Op0_t, Op1_t > m_c_BinaryOr(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:569
VPInstruction_match< VPInstruction::StepVector > m_StepVector()
Definition VPlanPatternMatch.h:465
match_combine_or< AllRecipe_match< Instruction::ZExt, Op0_t >, AllRecipe_match< Instruction::SExt, Op0_t > > m_ZExtOrSExt(const Op0_t &Op0)
Definition VPlanPatternMatch.h:498
match_combine_and< LTy, RTy > m_CombineAnd(const LTy &L, const RTy &R)
Combine two pattern matchers matching L && R.
Definition VPlanPatternMatch.h:253
SpecificCmp_match< Op0_t, Op1_t, Instruction::ICmp > m_SpecificICmp(CmpPredicate MatchPred, const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:640
VPScalarIVSteps_match< Op0_t, Op1_t, Op2_t > m_ScalarIVSteps(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
Definition VPlanPatternMatch.h:725
match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)
Combine two pattern matchers matching L || R.
Definition VPlanPatternMatch.h:247
AllRecipe_match< Instruction::Add, Op0_t, Op1_t > m_Add(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:521
GEPLikeRecipe_match< Op0_t, Op1_t > m_GetElementPtr(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:675
Recipe_match< std::tuple< OpTys... >, Opcode, false, VPInstruction > VPInstruction_match
Definition VPlanPatternMatch.h:346
AllRecipe_match< Opcode, Op0_t, Op1_t > m_Binary(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:509
VPInstruction_match< VPInstruction::LastActiveLane, Op0_t > m_LastActiveLane(const Op0_t &Op0)
Definition VPlanPatternMatch.h:461
AllRecipe_match< Opcode, Op0_t > m_Unary(const Op0_t &Op0)
Definition VPlanPatternMatch.h:470
Load_match< Addr_t, Mask_t > m_MaskedLoad(const Addr_t &Addr, const Mask_t &Mask)
Match a (possibly reversed) masked load.
Definition VPlanPatternMatch.h:756
match_combine_or< AllRecipe_match< Instruction::Trunc, Op0_t >, Op0_t > m_TruncOrSelf(const Op0_t &Op0)
Definition VPlanPatternMatch.h:481
AllRecipe_commutative_match< Instruction::Mul, Op0_t, Op1_t > m_c_Mul(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:546
Cmp_match< Op0_t, Op1_t, Instruction::ICmp > m_ICmp(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:627
AllRecipe_match< Instruction::Mul, Op0_t, Op1_t > m_Mul(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:539
specificval_ty m_Specific(const VPValue *VPV)
Definition VPlanPatternMatch.h:78
match_combine_or< Recipe_match< std::tuple< Op0_t, Op1_t >, Instruction::GetElementPtr, false, VPReplicateRecipe, VPWidenGEPRecipe >, match_combine_or< VPInstruction_match< VPInstruction::PtrAdd, Op0_t, Op1_t >, VPInstruction_match< VPInstruction::WidePtrAdd, Op0_t, Op1_t > > > GEPLikeRecipe_match
Definition VPlanPatternMatch.h:667
VPInstruction_match< Instruction::ExtractElement, Op0_t, Op1_t > m_ExtractElement(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:397
specific_intval< 1 > m_False()
Definition VPlanPatternMatch.h:143
VPDerivedIV_match< Op0_t, Op1_t, Op2_t > m_DerivedIV(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
Definition VPlanPatternMatch.h:735
VPMatchFunctor< Val, Pattern > match_fn(const Pattern &P)
A match functor that can be used as a UnaryPredicate in functional algorithms like all_of.
Definition VPlanPatternMatch.h:44
VPInstruction_match< VPInstruction::ExtractLastLane, Op0_t > m_ExtractLastLane(const Op0_t &Op0)
Definition VPlanPatternMatch.h:391
specific_intval< 0 > m_SpecificInt(uint64_t V)
Definition VPlanPatternMatch.h:139
VPInstruction_match< VPInstruction::ActiveLaneMask, Op0_t, Op1_t, Op2_t > m_ActiveLaneMask(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
Definition VPlanPatternMatch.h:429
live_in_vpvalue m_LiveIn()
Definition VPlanPatternMatch.h:909
VPInstruction_match< VPInstruction::BranchOnCount > m_BranchOnCount()
Definition VPlanPatternMatch.h:433
Recipe_match< std::tuple< Op0_t, Op1_t, Op2_t >, 0, false, VPDerivedIVRecipe > VPDerivedIV_match
Definition VPlanPatternMatch.h:730
AllRecipe_match< Instruction::Sub, Op0_t, Op1_t > m_Sub(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:533
AllRecipe_match< Instruction::SExt, Op0_t > m_SExt(const Op0_t &Op0)
Definition VPlanPatternMatch.h:491
specific_intval< 1 > m_True()
Definition VPlanPatternMatch.h:147
Recipe_match< std::tuple< OpTys... >, Opcode, false, VPWidenRecipe, VPReplicateRecipe, VPWidenCastRecipe, VPInstruction, VPWidenSelectRecipe > AllRecipe_match
Definition VPlanPatternMatch.h:335
IntrinsicID_match m_Intrinsic()
Match intrinsic calls like this: m_IntrinsicIntrinsic::fabs(m_VPValue(X), ...)
Definition VPlanPatternMatch.h:869
Recipe_match< std::tuple< OpTys... >, Opcode, true, VPWidenRecipe, VPReplicateRecipe, VPInstruction > AllRecipe_commutative_match
Definition VPlanPatternMatch.h:341
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()...
Definition VPlanPatternMatch.h:96
VectorEndPointerRecipe_match< Op0_t, Op1_t > m_VecEndPtr(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:792
VPInstruction_match< VPInstruction::ExtractLastPart, Op0_t > m_ExtractLastPart(const Op0_t &Op0)
Definition VPlanPatternMatch.h:409
VPInstruction_match< VPInstruction::Broadcast, Op0_t > m_Broadcast(const Op0_t &Op0)
Definition VPlanPatternMatch.h:379
bool match(Val *V, const Pattern &P)
Definition VPlanPatternMatch.h:22
class_match< VPValue > m_VPValue()
Match an arbitrary VPValue and ignore it.
Definition VPlanPatternMatch.h:53
OneUse_match< T > m_OneUse(const T &SubPattern)
Definition VPlanPatternMatch.h:921
VPInstruction_match< VPInstruction::ExplicitVectorLength, Op0_t > m_EVL(const Op0_t &Op0)
Definition VPlanPatternMatch.h:385
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...
Definition VPlanPatternMatch.h:357
AllRecipe_match< Instruction::Trunc, Op0_t > m_Trunc(const Op0_t &Op0)
Definition VPlanPatternMatch.h:475
VPInstruction_match< VPInstruction::ExtractPenultimateElement, Op0_t > m_ExtractPenultimateElement(const Op0_t &Op0)
Definition VPlanPatternMatch.h:423
Recipe_match< std::tuple< Op0_t, Op1_t >, 0, false, VPVectorEndPointerRecipe > VectorEndPointerRecipe_match
Definition VPlanPatternMatch.h:787
match_combine_or< AllRecipe_match< Instruction::ZExt, Op0_t >, Op0_t > m_ZExtOrSelf(const Op0_t &Op0)
Definition VPlanPatternMatch.h:504
VPInstruction_match< VPInstruction::FirstActiveLane, Op0_t > m_FirstActiveLane(const Op0_t &Op0)
Definition VPlanPatternMatch.h:455
Argument_match< Opnd_t > m_Argument(const Opnd_t &Op)
Match a call argument.
Definition VPlanPatternMatch.h:819
bind_ty< VPInstruction > m_VPInstruction(VPInstruction *&V)
Match a VPInstruction, capturing if we match.
Definition VPlanPatternMatch.h:261
Recipe_match< std::tuple< Op0_t, Op1_t, Op2_t >, 0, false, VPScalarIVStepsRecipe > VPScalarIVSteps_match
Definition VPlanPatternMatch.h:720
int_pred_ty< is_one > m_One()
Match an integer 1 or a vector with all elements equal to 1.
Definition VPlanPatternMatch.h:177
VPInstruction_match< VPInstruction::BranchOnCond > m_BranchOnCond()
Definition VPlanPatternMatch.h:367
VPInstruction_match< VPInstruction::ExtractLane, Op0_t, Op1_t > m_ExtractLane(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:403
bind_apint m_APInt(const APInt *&C)
Definition VPlanPatternMatch.h:199
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
DWARFExpression::Operation Op
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 - Return the argument parameter cast to the specified type.
Implement std::hash so that hash_code can be used in STL containers.
Intrinsic matches are combinations of ID matchers, and argument matchers.
A recipe for widening select instructions.
Match a call argument at a given argument index.
Definition VPlanPatternMatch.h:798
unsigned OpI
Call argument index to match.
Definition VPlanPatternMatch.h:800
Opnd_t Val
Definition VPlanPatternMatch.h:801
Argument_match(unsigned OpIdx, const Opnd_t &V)
Definition VPlanPatternMatch.h:803
bool match(OpTy *V) const
Definition VPlanPatternMatch.h:805
Cmp_match is a variant of BinaryRecipe_match that also binds the comparison predicate.
Definition VPlanPatternMatch.h:577
Cmp_match(CmpPredicate &Pred, const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:588
Cmp_match(const Op0_t &Op0, const Op1_t &Op1)
Definition VPlanPatternMatch.h:590
bool match(const VPValue *V) const
Definition VPlanPatternMatch.h:592
CmpPredicate * Predicate
Definition VPlanPatternMatch.h:584
bool match(const VPRecipeBase *V) const
Definition VPlanPatternMatch.h:597
Op0_t Op0
Definition VPlanPatternMatch.h:585
Op1_t Op1
Definition VPlanPatternMatch.h:586
Intrinsic matchers.
Definition VPlanPatternMatch.h:824
unsigned ID
Definition VPlanPatternMatch.h:825
IntrinsicID_match(Intrinsic::ID IntrID)
Definition VPlanPatternMatch.h:827
bool match(OpTy *V) const
Definition VPlanPatternMatch.h:829
Load_match(Addr_t Addr, Mask_t Mask)
Definition VPlanPatternMatch.h:743
Mask_t Mask
Definition VPlanPatternMatch.h:741
Addr_t Addr
Definition VPlanPatternMatch.h:740
bool match(const OpTy *V) const
Definition VPlanPatternMatch.h:745
SubPattern_t SubPattern
Definition VPlanPatternMatch.h:912
OneUse_match(const SubPattern_t &SP)
Definition VPlanPatternMatch.h:914
bool match(OpTy *V)
Definition VPlanPatternMatch.h:916
bool match(const VPSingleDefRecipe *R) const
Definition VPlanPatternMatch.h:280
Recipe_match(OpTy... Ops)
Definition VPlanPatternMatch.h:268
std::tuple< OpTys... > Ops
Definition VPlanPatternMatch.h:266
bool match(const VPValue *V) const
Definition VPlanPatternMatch.h:275
bool match(const VPRecipeBase *R) const
Definition VPlanPatternMatch.h:284
SpecificCmp_match is a variant of Cmp_match that matches the comparison predicate,...
Definition VPlanPatternMatch.h:610
Op0_t Op0
Definition VPlanPatternMatch.h:612
SpecificCmp_match(CmpPredicate Pred, const Op0_t &LHS, const Op1_t &RHS)
Definition VPlanPatternMatch.h:615
const CmpPredicate Predicate
Definition VPlanPatternMatch.h:611
Op1_t Op1
Definition VPlanPatternMatch.h:613
bool match(const VPValue *V) const
Definition VPlanPatternMatch.h:618
Mask_t Mask
Definition VPlanPatternMatch.h:764
Addr_t Addr
Definition VPlanPatternMatch.h:762
Store_match(Addr_t Addr, Val_t Val, Mask_t Mask)
Definition VPlanPatternMatch.h:766
bool match(const OpTy *V) const
Definition VPlanPatternMatch.h:769
Val_t Val
Definition VPlanPatternMatch.h:763
Definition VPlanPatternMatch.h:35
VPMatchFunctor(const Pattern &P)
Definition VPlanPatternMatch.h:37
const Pattern & P
Definition VPlanPatternMatch.h:36
bool operator()(Val *V) const
Definition VPlanPatternMatch.h:38
bool match(VPValue *VPV) const
Definition VPlanPatternMatch.h:184
bind_apint(const APInt *&Res)
Definition VPlanPatternMatch.h:182
const APInt *& Res
Definition VPlanPatternMatch.h:180
bool match(VPValue *VPV) const
Definition VPlanPatternMatch.h:206
bind_const_int(uint64_t &Res)
Definition VPlanPatternMatch.h:204
uint64_t & Res
Definition VPlanPatternMatch.h:202
Definition VPlanPatternMatch.h:55
bool match(ITy *V) const
Definition VPlanPatternMatch.h:60
bind_ty(Class *&V)
Definition VPlanPatternMatch.h:58
Class *& VR
Definition VPlanPatternMatch.h:56
Definition VPlanPatternMatch.h:48
bool match(ITy *V) const
Definition VPlanPatternMatch.h:49
Stores a reference to the VPValue *, not the VPValue * itself, thus can be used in commutative matche...
Definition VPlanPatternMatch.h:82
VPValue *const & Val
Definition VPlanPatternMatch.h:83
deferredval_ty(VPValue *const &V)
Definition VPlanPatternMatch.h:85
bool match(VPValue *const V) const
Definition VPlanPatternMatch.h:87
Match an integer constant or vector of constants if Pred::isValue returns true for the APInt.
Definition VPlanPatternMatch.h:102
int_pred_ty()
Definition VPlanPatternMatch.h:106
int_pred_ty(Pred P)
Definition VPlanPatternMatch.h:105
bool match(VPValue *VPV) const
Definition VPlanPatternMatch.h:108
is_specific_int P
Definition VPlanPatternMatch.h:103
bool isValue(const APInt &C) const
Definition VPlanPatternMatch.h:152
bool isValue(const APInt &C) const
Definition VPlanPatternMatch.h:166
Match a specified integer value or vector of all elements of that value.
Definition VPlanPatternMatch.h:128
bool isValue(const APInt &C) const
Definition VPlanPatternMatch.h:133
APInt Val
Definition VPlanPatternMatch.h:129
is_specific_int(APInt Val)
Definition VPlanPatternMatch.h:131
bool isValue(const APInt &C) const
Definition VPlanPatternMatch.h:162
bool match(ITy *V) const
Definition VPlanPatternMatch.h:903
match_combine_and< typename m_Intrinsic_Ty< T0, T1 >::Ty, Argument_match< T2 > > Ty
Definition VPlanPatternMatch.h:858
match_combine_and< typename m_Intrinsic_Ty< T0 >::Ty, Argument_match< T1 > > Ty
Definition VPlanPatternMatch.h:853
match_combine_and< IntrinsicID_match, Argument_match< T0 > > Ty
Definition VPlanPatternMatch.h:850
Intrinsic matches are combinations of ID matchers, and argument matchers.
Definition VPlanPatternMatch.h:862
match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2 >::Ty, Argument_match< T3 > > Ty
Definition VPlanPatternMatch.h:863
match_combine_and(const LTy &Left, const RTy &Right)
Definition VPlanPatternMatch.h:238
IntrinsicID_match L
Definition VPlanPatternMatch.h:235
Argument_match< T0 > R
Definition VPlanPatternMatch.h:236
bool match(ITy *V) const
Definition VPlanPatternMatch.h:240
Matching combinators.
Definition VPlanPatternMatch.h:223
Recipe_match< std::tuple< Op0_t, Op1_t >, Instruction::GetElementPtr, false, VPReplicateRecipe, VPWidenGEPRecipe > L
Definition VPlanPatternMatch.h:224
bool match(ITy *V) const
Definition VPlanPatternMatch.h:229
match_combine_or< VPInstruction_match< VPInstruction::PtrAdd, Op0_t, Op1_t >, VPInstruction_match< VPInstruction::WidePtrAdd, Op0_t, Op1_t > > R
Definition VPlanPatternMatch.h:225
match_combine_or(const LTy &Left, const RTy &Right)
Definition VPlanPatternMatch.h:227
Match a specified VPValue.
Definition VPlanPatternMatch.h:70
specificval_ty(const VPValue *V)
Definition VPlanPatternMatch.h:73
bool match(VPValue *VPV) const
Definition VPlanPatternMatch.h:75
const VPValue * Val
Definition VPlanPatternMatch.h:71