LLVM  15.0.0git
MIPatternMatch.h
Go to the documentation of this file.
1 //==------ llvm/CodeGen/GlobalISel/MIPatternMatch.h -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 /// \file
9 /// Contains matchers for matching SSA Machine Instructions.
10 ///
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H
14 #define LLVM_CODEGEN_GLOBALISEL_MIPATTERNMATCH_H
15 
16 #include "llvm/ADT/APInt.h"
19 #include "llvm/IR/InstrTypes.h"
20 
21 namespace llvm {
22 namespace MIPatternMatch {
23 
24 template <typename Reg, typename Pattern>
26  return P.match(MRI, R);
27 }
28 
29 template <typename Pattern>
31  return P.match(MRI, &MI);
32 }
33 
34 // TODO: Extend for N use.
35 template <typename SubPatternT> struct OneUse_match {
36  SubPatternT SubPat;
37  OneUse_match(const SubPatternT &SP) : SubPat(SP) {}
38 
40  return MRI.hasOneUse(Reg) && SubPat.match(MRI, Reg);
41  }
42 };
43 
44 template <typename SubPat>
45 inline OneUse_match<SubPat> m_OneUse(const SubPat &SP) {
46  return SP;
47 }
48 
49 template <typename SubPatternT> struct OneNonDBGUse_match {
50  SubPatternT SubPat;
51  OneNonDBGUse_match(const SubPatternT &SP) : SubPat(SP) {}
52 
54  return MRI.hasOneNonDBGUse(Reg) && SubPat.match(MRI, Reg);
55  }
56 };
57 
58 template <typename SubPat>
59 inline OneNonDBGUse_match<SubPat> m_OneNonDBGUse(const SubPat &SP) {
60  return SP;
61 }
62 
63 template <typename ConstT>
65 
66 template <>
68  const MachineRegisterInfo &MRI) {
69  return getIConstantVRegVal(Reg, MRI);
70 }
71 
72 template <>
74  const MachineRegisterInfo &MRI) {
76 }
77 
78 template <typename ConstT> struct ConstantMatch {
79  ConstT &CR;
80  ConstantMatch(ConstT &C) : CR(C) {}
82  if (auto MaybeCst = matchConstant<ConstT>(Reg, MRI)) {
83  CR = *MaybeCst;
84  return true;
85  }
86  return false;
87  }
88 };
89 
91  return ConstantMatch<APInt>(Cst);
92 }
93 inline ConstantMatch<int64_t> m_ICst(int64_t &Cst) {
94  return ConstantMatch<int64_t>(Cst);
95 }
96 
97 template <typename ConstT>
99  const MachineRegisterInfo &);
100 
101 template <>
103  const MachineRegisterInfo &MRI) {
104  return getIConstantSplatVal(Reg, MRI);
105 }
106 
107 template <>
109  const MachineRegisterInfo &MRI) {
111 }
112 
113 template <typename ConstT> struct ICstOrSplatMatch {
114  ConstT &CR;
115  ICstOrSplatMatch(ConstT &C) : CR(C) {}
117  if (auto MaybeCst = matchConstant<ConstT>(Reg, MRI)) {
118  CR = *MaybeCst;
119  return true;
120  }
121 
122  if (auto MaybeCstSplat = matchConstantSplat<ConstT>(Reg, MRI)) {
123  CR = *MaybeCstSplat;
124  return true;
125  }
126 
127  return false;
128  };
129 };
130 
132  return ICstOrSplatMatch<APInt>(Cst);
133 }
134 
136  return ICstOrSplatMatch<int64_t>(Cst);
137 }
138 
144  return ValReg ? true : false;
145  }
146 };
147 
149  return GCstAndRegMatch(ValReg);
150 }
151 
157  return FPValReg ? true : false;
158  }
159 };
160 
162  return GFCstAndRegMatch(FPValReg);
163 }
164 
168  : FPValReg(FPValReg) {}
170  return (FPValReg = getFConstantSplat(Reg, MRI)) ||
172  };
173 };
174 
175 inline GFCstOrSplatGFCstMatch
177  return GFCstOrSplatGFCstMatch(FPValReg);
178 }
179 
180 /// Matcher for a specific constant value.
182  int64_t RequestedVal;
185  int64_t MatchedVal;
186  return mi_match(Reg, MRI, m_ICst(MatchedVal)) && MatchedVal == RequestedVal;
187  }
188 };
189 
190 /// Matches a constant equal to \p RequestedValue.
191 inline SpecificConstantMatch m_SpecificICst(int64_t RequestedValue) {
192  return SpecificConstantMatch(RequestedValue);
193 }
194 
195 /// Matcher for a specific constant splat.
197  int64_t RequestedVal;
202  /* AllowUndef */ false);
203  }
204 };
205 
206 /// Matches a constant splat of \p RequestedValue.
207 inline SpecificConstantSplatMatch m_SpecificICstSplat(int64_t RequestedValue) {
208  return SpecificConstantSplatMatch(RequestedValue);
209 }
210 
211 /// Matcher for a specific constant or constant splat.
213  int64_t RequestedVal;
217  int64_t MatchedVal;
218  if (mi_match(Reg, MRI, m_ICst(MatchedVal)) && MatchedVal == RequestedVal)
219  return true;
221  /* AllowUndef */ false);
222  }
223 };
224 
225 /// Matches a \p RequestedValue constant or a constant splat of \p
226 /// RequestedValue.
227 inline SpecificConstantOrSplatMatch
228 m_SpecificICstOrSplat(int64_t RequestedValue) {
229  return SpecificConstantOrSplatMatch(RequestedValue);
230 }
231 
232 ///{
233 /// Convenience matchers for specific integer values.
236  return SpecificConstantMatch(-1);
237 }
238 ///}
239 
240 // TODO: Rework this for different kinds of MachineOperand.
241 // Currently assumes the Src for a match is a register.
242 // We might want to support taking in some MachineOperands and call getReg on
243 // that.
244 
246  bool match(const MachineRegisterInfo &MRI, Register Reg) { return true; }
248  return MO->isReg();
249  }
250 };
251 
253 
254 /// Matching combinators.
255 template <typename... Preds> struct And {
256  template <typename MatchSrc>
257  bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
258  return true;
259  }
260 };
261 
262 template <typename Pred, typename... Preds>
263 struct And<Pred, Preds...> : And<Preds...> {
264  Pred P;
265  And(Pred &&p, Preds &&... preds)
266  : And<Preds...>(std::forward<Preds>(preds)...), P(std::forward<Pred>(p)) {
267  }
268  template <typename MatchSrc>
269  bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
270  return P.match(MRI, src) && And<Preds...>::match(MRI, src);
271  }
272 };
273 
274 template <typename... Preds> struct Or {
275  template <typename MatchSrc>
276  bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
277  return false;
278  }
279 };
280 
281 template <typename Pred, typename... Preds>
282 struct Or<Pred, Preds...> : Or<Preds...> {
283  Pred P;
284  Or(Pred &&p, Preds &&... preds)
285  : Or<Preds...>(std::forward<Preds>(preds)...), P(std::forward<Pred>(p)) {}
286  template <typename MatchSrc>
287  bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
288  return P.match(MRI, src) || Or<Preds...>::match(MRI, src);
289  }
290 };
291 
292 template <typename... Preds> And<Preds...> m_all_of(Preds &&... preds) {
293  return And<Preds...>(std::forward<Preds>(preds)...);
294 }
295 
296 template <typename... Preds> Or<Preds...> m_any_of(Preds &&... preds) {
297  return Or<Preds...>(std::forward<Preds>(preds)...);
298 }
299 
300 template <typename BindTy> struct bind_helper {
301  static bool bind(const MachineRegisterInfo &MRI, BindTy &VR, BindTy &V) {
302  VR = V;
303  return true;
304  }
305 };
306 
307 template <> struct bind_helper<MachineInstr *> {
308  static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI,
309  Register Reg) {
310  MI = MRI.getVRegDef(Reg);
311  if (MI)
312  return true;
313  return false;
314  }
315  static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI,
316  MachineInstr *Inst) {
317  MI = Inst;
318  return MI;
319  }
320 };
321 
322 template <> struct bind_helper<LLT> {
323  static bool bind(const MachineRegisterInfo &MRI, LLT Ty, Register Reg) {
324  Ty = MRI.getType(Reg);
325  if (Ty.isValid())
326  return true;
327  return false;
328  }
329 };
330 
331 template <> struct bind_helper<const ConstantFP *> {
332  static bool bind(const MachineRegisterInfo &MRI, const ConstantFP *&F,
333  Register Reg) {
335  if (F)
336  return true;
337  return false;
338  }
339 };
340 
341 template <typename Class> struct bind_ty {
342  Class &VR;
343 
344  bind_ty(Class &V) : VR(V) {}
345 
346  template <typename ITy> bool match(const MachineRegisterInfo &MRI, ITy &&V) {
347  return bind_helper<Class>::bind(MRI, VR, V);
348  }
349 };
350 
351 inline bind_ty<Register> m_Reg(Register &R) { return R; }
353 inline bind_ty<LLT> m_Type(LLT Ty) { return Ty; }
356 
357 // Helper for matching G_FCONSTANT
358 inline bind_ty<const ConstantFP *> m_GFCst(const ConstantFP *&C) { return C; }
359 
360 // General helper for all the binary generic MI such as G_ADD/G_SUB etc
361 template <typename LHS_P, typename RHS_P, unsigned Opcode,
362  bool Commutable = false>
364  LHS_P L;
365  RHS_P R;
366 
367  BinaryOp_match(const LHS_P &LHS, const RHS_P &RHS) : L(LHS), R(RHS) {}
368  template <typename OpTy>
369  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
370  MachineInstr *TmpMI;
371  if (mi_match(Op, MRI, m_MInstr(TmpMI))) {
372  if (TmpMI->getOpcode() == Opcode && TmpMI->getNumOperands() == 3) {
373  return (L.match(MRI, TmpMI->getOperand(1).getReg()) &&
374  R.match(MRI, TmpMI->getOperand(2).getReg())) ||
375  (Commutable && (R.match(MRI, TmpMI->getOperand(1).getReg()) &&
376  L.match(MRI, TmpMI->getOperand(2).getReg())));
377  }
378  }
379  return false;
380  }
381 };
382 
383 // Helper for (commutative) binary generic MI that checks Opcode.
384 template <typename LHS_P, typename RHS_P, bool Commutable = false>
386  unsigned Opc;
387  LHS_P L;
388  RHS_P R;
389 
390  BinaryOpc_match(unsigned Opcode, const LHS_P &LHS, const RHS_P &RHS)
391  : Opc(Opcode), L(LHS), R(RHS) {}
392  template <typename OpTy>
393  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
394  MachineInstr *TmpMI;
395  if (mi_match(Op, MRI, m_MInstr(TmpMI))) {
396  if (TmpMI->getOpcode() == Opc && TmpMI->getNumDefs() == 1 &&
397  TmpMI->getNumOperands() == 3) {
398  return (L.match(MRI, TmpMI->getOperand(1).getReg()) &&
399  R.match(MRI, TmpMI->getOperand(2).getReg())) ||
400  (Commutable && (R.match(MRI, TmpMI->getOperand(1).getReg()) &&
401  L.match(MRI, TmpMI->getOperand(2).getReg())));
402  }
403  }
404  return false;
405  }
406 };
407 
408 template <typename LHS, typename RHS>
409 inline BinaryOpc_match<LHS, RHS, false> m_BinOp(unsigned Opcode, const LHS &L,
410  const RHS &R) {
411  return BinaryOpc_match<LHS, RHS, false>(Opcode, L, R);
412 }
413 
414 template <typename LHS, typename RHS>
415 inline BinaryOpc_match<LHS, RHS, true>
416 m_CommutativeBinOp(unsigned Opcode, const LHS &L, const RHS &R) {
417  return BinaryOpc_match<LHS, RHS, true>(Opcode, L, R);
418 }
419 
420 template <typename LHS, typename RHS>
422 m_GAdd(const LHS &L, const RHS &R) {
424 }
425 
426 template <typename LHS, typename RHS>
428 m_GPtrAdd(const LHS &L, const RHS &R) {
430 }
431 
432 template <typename LHS, typename RHS>
434  const RHS &R) {
436 }
437 
438 template <typename LHS, typename RHS>
440 m_GMul(const LHS &L, const RHS &R) {
442 }
443 
444 template <typename LHS, typename RHS>
446 m_GFAdd(const LHS &L, const RHS &R) {
448 }
449 
450 template <typename LHS, typename RHS>
452 m_GFMul(const LHS &L, const RHS &R) {
454 }
455 
456 template <typename LHS, typename RHS>
458 m_GFSub(const LHS &L, const RHS &R) {
460 }
461 
462 template <typename LHS, typename RHS>
464 m_GAnd(const LHS &L, const RHS &R) {
466 }
467 
468 template <typename LHS, typename RHS>
470 m_GXor(const LHS &L, const RHS &R) {
472 }
473 
474 template <typename LHS, typename RHS>
476  const RHS &R) {
478 }
479 
480 template <typename LHS, typename RHS>
482 m_GShl(const LHS &L, const RHS &R) {
484 }
485 
486 template <typename LHS, typename RHS>
488 m_GLShr(const LHS &L, const RHS &R) {
490 }
491 
492 template <typename LHS, typename RHS>
494 m_GAShr(const LHS &L, const RHS &R) {
496 }
497 
498 template <typename LHS, typename RHS>
500 m_GSMax(const LHS &L, const RHS &R) {
502 }
503 
504 template <typename LHS, typename RHS>
506 m_GSMin(const LHS &L, const RHS &R) {
508 }
509 
510 // Helper for unary instructions (G_[ZSA]EXT/G_TRUNC) etc
511 template <typename SrcTy, unsigned Opcode> struct UnaryOp_match {
512  SrcTy L;
513 
514  UnaryOp_match(const SrcTy &LHS) : L(LHS) {}
515  template <typename OpTy>
516  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
517  MachineInstr *TmpMI;
518  if (mi_match(Op, MRI, m_MInstr(TmpMI))) {
519  if (TmpMI->getOpcode() == Opcode && TmpMI->getNumOperands() == 2) {
520  return L.match(MRI, TmpMI->getOperand(1).getReg());
521  }
522  }
523  return false;
524  }
525 };
526 
527 template <typename SrcTy>
528 inline UnaryOp_match<SrcTy, TargetOpcode::G_ANYEXT>
529 m_GAnyExt(const SrcTy &Src) {
531 }
532 
533 template <typename SrcTy>
536 }
537 
538 template <typename SrcTy>
541 }
542 
543 template <typename SrcTy>
546 }
547 
548 template <typename SrcTy>
551 }
552 
553 template <typename SrcTy>
554 inline UnaryOp_match<SrcTy, TargetOpcode::G_BITCAST>
555 m_GBitcast(const SrcTy &Src) {
557 }
558 
559 template <typename SrcTy>
560 inline UnaryOp_match<SrcTy, TargetOpcode::G_PTRTOINT>
561 m_GPtrToInt(const SrcTy &Src) {
563 }
564 
565 template <typename SrcTy>
566 inline UnaryOp_match<SrcTy, TargetOpcode::G_INTTOPTR>
567 m_GIntToPtr(const SrcTy &Src) {
569 }
570 
571 template <typename SrcTy>
572 inline UnaryOp_match<SrcTy, TargetOpcode::G_FPTRUNC>
573 m_GFPTrunc(const SrcTy &Src) {
575 }
576 
577 template <typename SrcTy>
580 }
581 
582 template <typename SrcTy>
585 }
586 
587 template <typename SrcTy>
589  return UnaryOp_match<SrcTy, TargetOpcode::COPY>(std::forward<SrcTy>(Src));
590 }
591 
592 template <typename SrcTy>
595 }
596 
597 // General helper for generic MI compares, i.e. G_ICMP and G_FCMP
598 // TODO: Allow checking a specific predicate.
599 template <typename Pred_P, typename LHS_P, typename RHS_P, unsigned Opcode>
601  Pred_P P;
602  LHS_P L;
603  RHS_P R;
604 
605  CompareOp_match(const Pred_P &Pred, const LHS_P &LHS, const RHS_P &RHS)
606  : P(Pred), L(LHS), R(RHS) {}
607 
608  template <typename OpTy>
609  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
610  MachineInstr *TmpMI;
611  if (!mi_match(Op, MRI, m_MInstr(TmpMI)) || TmpMI->getOpcode() != Opcode)
612  return false;
613 
614  auto TmpPred =
615  static_cast<CmpInst::Predicate>(TmpMI->getOperand(1).getPredicate());
616  if (!P.match(MRI, TmpPred))
617  return false;
618 
619  return L.match(MRI, TmpMI->getOperand(2).getReg()) &&
620  R.match(MRI, TmpMI->getOperand(3).getReg());
621  }
622 };
623 
624 template <typename Pred, typename LHS, typename RHS>
625 inline CompareOp_match<Pred, LHS, RHS, TargetOpcode::G_ICMP>
626 m_GICmp(const Pred &P, const LHS &L, const RHS &R) {
628 }
629 
630 template <typename Pred, typename LHS, typename RHS>
631 inline CompareOp_match<Pred, LHS, RHS, TargetOpcode::G_FCMP>
632 m_GFCmp(const Pred &P, const LHS &L, const RHS &R) {
634 }
635 
636 // Helper for checking if a Reg is of specific type.
637 struct CheckType {
639  CheckType(const LLT Ty) : Ty(Ty) {}
640 
642  return MRI.getType(Reg) == Ty;
643  }
644 };
645 
646 inline CheckType m_SpecificType(LLT Ty) { return Ty; }
647 
648 template <typename Src0Ty, typename Src1Ty, typename Src2Ty, unsigned Opcode>
650  Src0Ty Src0;
651  Src1Ty Src1;
652  Src2Ty Src2;
653 
654  TernaryOp_match(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
655  : Src0(Src0), Src1(Src1), Src2(Src2) {}
656  template <typename OpTy>
657  bool match(const MachineRegisterInfo &MRI, OpTy &&Op) {
658  MachineInstr *TmpMI;
659  if (mi_match(Op, MRI, m_MInstr(TmpMI))) {
660  if (TmpMI->getOpcode() == Opcode && TmpMI->getNumOperands() == 4) {
661  return (Src0.match(MRI, TmpMI->getOperand(1).getReg()) &&
662  Src1.match(MRI, TmpMI->getOperand(2).getReg()) &&
663  Src2.match(MRI, TmpMI->getOperand(3).getReg()));
664  }
665  }
666  return false;
667  }
668 };
669 template <typename Src0Ty, typename Src1Ty, typename Src2Ty>
670 inline TernaryOp_match<Src0Ty, Src1Ty, Src2Ty,
671  TargetOpcode::G_INSERT_VECTOR_ELT>
672 m_GInsertVecElt(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2) {
673  return TernaryOp_match<Src0Ty, Src1Ty, Src2Ty,
674  TargetOpcode::G_INSERT_VECTOR_ELT>(Src0, Src1, Src2);
675 }
676 
677 template <typename Src0Ty, typename Src1Ty, typename Src2Ty>
678 inline TernaryOp_match<Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_SELECT>
679 m_GISelect(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2) {
681  Src0, Src1, Src2);
682 }
683 
684 /// Matches a register negated by a G_SUB.
685 /// G_SUB 0, %negated_reg
686 template <typename SrcTy>
688 m_Neg(const SrcTy &&Src) {
689  return m_GSub(m_ZeroInt(), Src);
690 }
691 
692 /// Matches a register not-ed by a G_XOR.
693 /// G_XOR %not_reg, -1
694 template <typename SrcTy>
696 m_Not(const SrcTy &&Src) {
697  return m_GXor(Src, m_AllOnesInt());
698 }
699 
700 } // namespace MIPatternMatch
701 } // namespace llvm
702 
703 #endif
llvm::MIPatternMatch::m_ICstOrSplat
ICstOrSplatMatch< APInt > m_ICstOrSplat(APInt &Cst)
Definition: MIPatternMatch.h:131
llvm::MIPatternMatch::CheckType
Definition: MIPatternMatch.h:637
llvm::getIConstantVRegSExtVal
Optional< int64_t > getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT fits in int64_t returns it.
Definition: Utils.cpp:298
llvm::MIPatternMatch::operand_type_match::match
bool match(const MachineRegisterInfo &MRI, MachineOperand *MO)
Definition: MIPatternMatch.h:247
llvm::MIPatternMatch::TernaryOp_match::match
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
Definition: MIPatternMatch.h:657
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::PatternMatch::BinaryOp_match
Definition: PatternMatch.h:961
llvm::MIPatternMatch::bind_helper< LLT >::bind
static bool bind(const MachineRegisterInfo &MRI, LLT Ty, Register Reg)
Definition: MIPatternMatch.h:323
llvm::MIPatternMatch::m_SpecificICstSplat
SpecificConstantSplatMatch m_SpecificICstSplat(int64_t RequestedValue)
Matches a constant splat of RequestedValue.
Definition: MIPatternMatch.h:207
llvm::MIPatternMatch::UnaryOp_match::UnaryOp_match
UnaryOp_match(const SrcTy &LHS)
Definition: MIPatternMatch.h:514
llvm::MIPatternMatch::GFCstAndRegMatch::FPValReg
Optional< FPValueAndVReg > & FPValReg
Definition: MIPatternMatch.h:153
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:719
llvm::MIPatternMatch::m_GFPExt
UnaryOp_match< SrcTy, TargetOpcode::G_FPEXT > m_GFPExt(const SrcTy &Src)
Definition: MIPatternMatch.h:544
llvm::MIPatternMatch::m_GFNeg
UnaryOp_match< SrcTy, TargetOpcode::G_FNEG > m_GFNeg(const SrcTy &Src)
Definition: MIPatternMatch.h:583
llvm::MIPatternMatch::m_Reg
operand_type_match m_Reg()
Definition: MIPatternMatch.h:252
llvm::MIPatternMatch::m_GAnd
BinaryOp_match< LHS, RHS, TargetOpcode::G_AND, true > m_GAnd(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:464
llvm::MIPatternMatch::m_GShl
BinaryOp_match< LHS, RHS, TargetOpcode::G_SHL, false > m_GShl(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:482
llvm::MachineRegisterInfo
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Definition: MachineRegisterInfo.h:50
llvm::MIPatternMatch::SpecificConstantSplatMatch::RequestedVal
int64_t RequestedVal
Definition: MIPatternMatch.h:197
llvm::MIPatternMatch::Or< Pred, Preds... >::P
Pred P
Definition: MIPatternMatch.h:283
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::MIPatternMatch::m_GLShr
BinaryOp_match< LHS, RHS, TargetOpcode::G_LSHR, false > m_GLShr(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:488
llvm::MIPatternMatch::BinaryOpc_match::Opc
unsigned Opc
Definition: MIPatternMatch.h:386
llvm::MIPatternMatch::UnaryOp_match::L
SrcTy L
Definition: MIPatternMatch.h:512
llvm::MCID::Commutable
@ Commutable
Definition: MCInstrDesc.h:173
llvm::MIPatternMatch::m_OneNonDBGUse
OneNonDBGUse_match< SubPat > m_OneNonDBGUse(const SubPat &SP)
Definition: MIPatternMatch.h:59
llvm::MIPatternMatch::GCstAndRegMatch::GCstAndRegMatch
GCstAndRegMatch(Optional< ValueAndVReg > &ValReg)
Definition: MIPatternMatch.h:141
llvm::MIPatternMatch::m_GSub
BinaryOp_match< LHS, RHS, TargetOpcode::G_SUB > m_GSub(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:433
llvm::MIPatternMatch::matchConstantSplat
Optional< ConstT > matchConstantSplat(Register, const MachineRegisterInfo &)
Definition: MIPatternMatch.h:102
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::MIPatternMatch::BinaryOpc_match::L
LHS_P L
Definition: MIPatternMatch.h:387
llvm::MIPatternMatch::m_GTrunc
UnaryOp_match< SrcTy, TargetOpcode::G_TRUNC > m_GTrunc(const SrcTy &Src)
Definition: MIPatternMatch.h:549
APInt.h
llvm::MIPatternMatch::BinaryOpc_match::R
RHS_P R
Definition: MIPatternMatch.h:388
llvm::MIPatternMatch::m_GFSub
BinaryOp_match< LHS, RHS, TargetOpcode::G_FSUB, false > m_GFSub(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:458
true
basic Basic Alias true
Definition: BasicAliasAnalysis.cpp:1909
llvm::MIPatternMatch::m_GSMax
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMAX, false > m_GSMax(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:500
llvm::MIPatternMatch::CheckType::CheckType
CheckType(const LLT Ty)
Definition: MIPatternMatch.h:639
llvm::MIPatternMatch::m_GICmp
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_ICMP > m_GICmp(const Pred &P, const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:626
llvm::LLT::isValid
bool isValid() const
Definition: LowLevelTypeImpl.h:116
llvm::MIPatternMatch::m_GFAdd
BinaryOp_match< LHS, RHS, TargetOpcode::G_FADD, true > m_GFAdd(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:446
llvm::Optional
Definition: APInt.h:33
llvm::MIPatternMatch::BinaryOpc_match::match
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
Definition: MIPatternMatch.h:393
llvm::MIPatternMatch::m_GSMin
BinaryOp_match< LHS, RHS, TargetOpcode::G_SMIN, false > m_GSMin(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:506
llvm::MIPatternMatch::bind_ty::match
bool match(const MachineRegisterInfo &MRI, ITy &&V)
Definition: MIPatternMatch.h:346
RHS
Value * RHS
Definition: X86PartialReduction.cpp:76
llvm::MIPatternMatch::SpecificConstantMatch::RequestedVal
int64_t RequestedVal
Definition: MIPatternMatch.h:182
llvm::MIPatternMatch::SpecificConstantOrSplatMatch::RequestedVal
int64_t RequestedVal
Definition: MIPatternMatch.h:213
preds
preds
Definition: README.txt:340
p
the resulting code requires compare and branches when and if * p
Definition: README.txt:396
llvm::MIPatternMatch::BinaryOpc_match::BinaryOpc_match
BinaryOpc_match(unsigned Opcode, const LHS_P &LHS, const RHS_P &RHS)
Definition: MIPatternMatch.h:390
llvm::MIPatternMatch::m_GPtrAdd
BinaryOp_match< LHS, RHS, TargetOpcode::G_PTR_ADD, false > m_GPtrAdd(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:428
llvm::MIPatternMatch::BinaryOp_match::R
RHS_P R
Definition: MIPatternMatch.h:365
llvm::MIPatternMatch::BinaryOp_match::L
LHS_P L
Definition: MIPatternMatch.h:364
llvm::MIPatternMatch::m_GPtrToInt
UnaryOp_match< SrcTy, TargetOpcode::G_PTRTOINT > m_GPtrToInt(const SrcTy &Src)
Definition: MIPatternMatch.h:561
llvm::MIPatternMatch::m_GFabs
UnaryOp_match< SrcTy, TargetOpcode::G_FABS > m_GFabs(const SrcTy &Src)
Definition: MIPatternMatch.h:578
F
#define F(x, y, z)
Definition: MD5.cpp:55
MachineRegisterInfo.h
llvm::MachineInstr::getNumDefs
unsigned getNumDefs() const
Returns the total number of definitions.
Definition: MachineInstr.h:569
llvm::MIPatternMatch::operand_type_match::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:246
llvm::MIPatternMatch::OneNonDBGUse_match
Definition: MIPatternMatch.h:49
llvm::MIPatternMatch::m_GFCst
GFCstAndRegMatch m_GFCst(Optional< FPValueAndVReg > &FPValReg)
Definition: MIPatternMatch.h:161
llvm::MIPatternMatch::m_GSExt
UnaryOp_match< SrcTy, TargetOpcode::G_SEXT > m_GSExt(const SrcTy &Src)
Definition: MIPatternMatch.h:534
LHS
Value * LHS
Definition: X86PartialReduction.cpp:75
llvm::MIPatternMatch::m_GMul
BinaryOp_match< LHS, RHS, TargetOpcode::G_MUL, true > m_GMul(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:440
llvm::MIPatternMatch::ConstantMatch
Definition: MIPatternMatch.h:78
llvm::MIPatternMatch::TernaryOp_match::TernaryOp_match
TernaryOp_match(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
Definition: MIPatternMatch.h:654
llvm::MIPatternMatch::m_GZExt
UnaryOp_match< SrcTy, TargetOpcode::G_ZEXT > m_GZExt(const SrcTy &Src)
Definition: MIPatternMatch.h:539
llvm::MIPatternMatch::OneNonDBGUse_match::OneNonDBGUse_match
OneNonDBGUse_match(const SubPatternT &SP)
Definition: MIPatternMatch.h:51
llvm::MIPatternMatch::GFCstOrSplatGFCstMatch
Definition: MIPatternMatch.h:165
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::MachineInstr::getOperand
const MachineOperand & getOperand(unsigned i) const
Definition: MachineInstr.h:501
llvm::MIPatternMatch::Or::match
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Definition: MIPatternMatch.h:276
llvm::MIPatternMatch::GCstAndRegMatch
Definition: MIPatternMatch.h:139
llvm::MIPatternMatch::SpecificConstantMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:184
InstrTypes.h
llvm::MIPatternMatch::SpecificConstantOrSplatMatch
Matcher for a specific constant or constant splat.
Definition: MIPatternMatch.h:212
Utils.h
llvm::MIPatternMatch::bind_ty
Definition: MIPatternMatch.h:341
llvm::MIPatternMatch::m_GIntToPtr
UnaryOp_match< SrcTy, TargetOpcode::G_INTTOPTR > m_GIntToPtr(const SrcTy &Src)
Definition: MIPatternMatch.h:567
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:48
llvm::MIPatternMatch::m_ZeroInt
SpecificConstantMatch m_ZeroInt()
{ Convenience matchers for specific integer values.
Definition: MIPatternMatch.h:234
llvm::MIPatternMatch::Or< Pred, Preds... >::match
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Definition: MIPatternMatch.h:287
llvm::MIPatternMatch::ICstOrSplatMatch
Definition: MIPatternMatch.h:113
llvm::MIPatternMatch::m_GFCstOrSplat
GFCstOrSplatGFCstMatch m_GFCstOrSplat(Optional< FPValueAndVReg > &FPValReg)
Definition: MIPatternMatch.h:176
llvm::ConstantFP
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:257
llvm::MIPatternMatch::BinaryOpc_match
Definition: MIPatternMatch.h:385
llvm::MIPatternMatch::Or< Pred, Preds... >::Or
Or(Pred &&p, Preds &&... preds)
Definition: MIPatternMatch.h:284
llvm::MIPatternMatch::bind_helper< MachineInstr * >::bind
static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI, Register Reg)
Definition: MIPatternMatch.h:308
llvm::MIPatternMatch::m_SpecificICst
SpecificConstantMatch m_SpecificICst(int64_t RequestedValue)
Matches a constant equal to RequestedValue.
Definition: MIPatternMatch.h:191
llvm::MIPatternMatch::OneUse_match::OneUse_match
OneUse_match(const SubPatternT &SP)
Definition: MIPatternMatch.h:37
llvm::MIPatternMatch::UnaryOp_match::match
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
Definition: MIPatternMatch.h:516
llvm::MIPatternMatch::m_MInstr
bind_ty< MachineInstr * > m_MInstr(MachineInstr *&MI)
Definition: MIPatternMatch.h:352
llvm::MIPatternMatch::m_Pred
bind_ty< CmpInst::Predicate > m_Pred(CmpInst::Predicate &P)
Definition: MIPatternMatch.h:354
llvm::MIPatternMatch::m_SpecificType
CheckType m_SpecificType(LLT Ty)
Definition: MIPatternMatch.h:646
llvm::MIPatternMatch::GFCstOrSplatGFCstMatch::FPValReg
Optional< FPValueAndVReg > & FPValReg
Definition: MIPatternMatch.h:166
llvm::MIPatternMatch::UnaryOp_match
Definition: MIPatternMatch.h:511
llvm::MIPatternMatch::m_GAnyExt
UnaryOp_match< SrcTy, TargetOpcode::G_ANYEXT > m_GAnyExt(const SrcTy &Src)
Definition: MIPatternMatch.h:529
llvm::MIPatternMatch::CompareOp_match::match
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
Definition: MIPatternMatch.h:609
llvm::MIPatternMatch::SpecificConstantMatch::SpecificConstantMatch
SpecificConstantMatch(int64_t RequestedVal)
Definition: MIPatternMatch.h:183
llvm::MIPatternMatch::m_GOr
BinaryOp_match< LHS, RHS, TargetOpcode::G_OR, true > m_GOr(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:475
llvm::MachineOperand::isReg
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Definition: MachineOperand.h:320
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
llvm::MIPatternMatch::BinaryOp_match
Definition: MIPatternMatch.h:363
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::MIPatternMatch::OneNonDBGUse_match::SubPat
SubPatternT SubPat
Definition: MIPatternMatch.h:50
llvm::MIPatternMatch::And< Pred, Preds... >::match
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Definition: MIPatternMatch.h:269
llvm::MIPatternMatch::bind_ty::VR
Class & VR
Definition: MIPatternMatch.h:342
llvm::MIPatternMatch::Or
Definition: MIPatternMatch.h:274
llvm::MIPatternMatch::m_CommutativeBinOp
BinaryOpc_match< LHS, RHS, true > m_CommutativeBinOp(unsigned Opcode, const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:416
llvm::MIPatternMatch::matchConstant
Optional< ConstT > matchConstant(Register, const MachineRegisterInfo &)
Definition: MIPatternMatch.h:67
llvm::MIPatternMatch::m_AllOnesInt
SpecificConstantMatch m_AllOnesInt()
Definition: MIPatternMatch.h:235
llvm::MIPatternMatch::And
Matching combinators.
Definition: MIPatternMatch.h:255
llvm::MIPatternMatch::CheckType::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:641
llvm::MachineOperand::getPredicate
unsigned getPredicate() const
Definition: MachineOperand.h:597
llvm::MIPatternMatch::GFCstOrSplatGFCstMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:169
llvm::MIPatternMatch::m_Type
bind_ty< LLT > m_Type(LLT Ty)
Definition: MIPatternMatch.h:353
llvm::MIPatternMatch::SpecificConstantSplatMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:200
llvm::getIConstantVRegVal
Optional< APInt > getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT, return the corresponding value.
Definition: Utils.cpp:286
llvm::MachineOperand::getReg
Register getReg() const
getReg - Returns the register number.
Definition: MachineOperand.h:359
llvm::MIPatternMatch::OneNonDBGUse_match::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:53
llvm::MIPatternMatch::bind_ty::bind_ty
bind_ty(Class &V)
Definition: MIPatternMatch.h:344
llvm::getIConstantSplatSExtVal
Optional< int64_t > getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI)
Definition: Utils.cpp:1091
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::MIPatternMatch::TernaryOp_match::Src2
Src2Ty Src2
Definition: MIPatternMatch.h:652
llvm::MIPatternMatch::BinaryOp_match::match
bool match(const MachineRegisterInfo &MRI, OpTy &&Op)
Definition: MIPatternMatch.h:369
llvm::MIPatternMatch::GCstAndRegMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:142
llvm::MIPatternMatch::GFCstAndRegMatch::GFCstAndRegMatch
GFCstAndRegMatch(Optional< FPValueAndVReg > &FPValReg)
Definition: MIPatternMatch.h:154
llvm::getIConstantVRegValWithLookThrough
Optional< ValueAndVReg > getIConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its...
Definition: Utils.cpp:407
llvm::MachineInstr::getOpcode
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Definition: MachineInstr.h:491
llvm::MIPatternMatch::ICstOrSplatMatch::CR
ConstT & CR
Definition: MIPatternMatch.h:114
llvm::MIPatternMatch::m_any_of
Or< Preds... > m_any_of(Preds &&... preds)
Definition: MIPatternMatch.h:296
llvm::MIPatternMatch::m_GXor
BinaryOp_match< LHS, RHS, TargetOpcode::G_XOR, true > m_GXor(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:470
llvm::MIPatternMatch::ConstantMatch::ConstantMatch
ConstantMatch(ConstT &C)
Definition: MIPatternMatch.h:80
llvm::MIPatternMatch::TernaryOp_match::Src1
Src1Ty Src1
Definition: MIPatternMatch.h:651
llvm::MIPatternMatch::bind_helper::bind
static bool bind(const MachineRegisterInfo &MRI, BindTy &VR, BindTy &V)
Definition: MIPatternMatch.h:301
llvm::MIPatternMatch::m_Copy
UnaryOp_match< SrcTy, TargetOpcode::COPY > m_Copy(SrcTy &&Src)
Definition: MIPatternMatch.h:588
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::MIPatternMatch::m_SpecificICstOrSplat
SpecificConstantOrSplatMatch m_SpecificICstOrSplat(int64_t RequestedValue)
Matches a RequestedValue constant or a constant splat of RequestedValue.
Definition: MIPatternMatch.h:228
llvm::MIPatternMatch::SpecificConstantOrSplatMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:216
llvm::MIPatternMatch::m_GAShr
BinaryOp_match< LHS, RHS, TargetOpcode::G_ASHR, false > m_GAShr(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:494
llvm::MIPatternMatch::And::match
bool match(const MachineRegisterInfo &MRI, MatchSrc &&src)
Definition: MIPatternMatch.h:257
std
Definition: BitVector.h:851
llvm::MIPatternMatch::m_ICst
ConstantMatch< APInt > m_ICst(APInt &Cst)
Definition: MIPatternMatch.h:90
llvm::MIPatternMatch::m_GFCmp
CompareOp_match< Pred, LHS, RHS, TargetOpcode::G_FCMP > m_GFCmp(const Pred &P, const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:632
llvm::MIPatternMatch::m_GAdd
BinaryOp_match< LHS, RHS, TargetOpcode::G_ADD, true > m_GAdd(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:422
llvm::MIPatternMatch::m_GFSqrt
UnaryOp_match< SrcTy, TargetOpcode::G_FSQRT > m_GFSqrt(const SrcTy &Src)
Definition: MIPatternMatch.h:593
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:344
llvm::MIPatternMatch::ICstOrSplatMatch::ICstOrSplatMatch
ICstOrSplatMatch(ConstT &C)
Definition: MIPatternMatch.h:115
llvm::MIPatternMatch::m_GCst
GCstAndRegMatch m_GCst(Optional< ValueAndVReg > &ValReg)
Definition: MIPatternMatch.h:148
llvm::MIPatternMatch::CompareOp_match::P
Pred_P P
Definition: MIPatternMatch.h:601
llvm::MIPatternMatch::CompareOp_match
Definition: MIPatternMatch.h:600
llvm::getIConstantSplatVal
Optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
Definition: Utils.cpp:1073
llvm::MIPatternMatch::And< Pred, Preds... >::P
Pred P
Definition: MIPatternMatch.h:264
llvm::MIPatternMatch::GFCstAndRegMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:155
llvm::MIPatternMatch::m_GISelect
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_SELECT > m_GISelect(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
Definition: MIPatternMatch.h:679
llvm::getFConstantVRegValWithLookThrough
Optional< FPValueAndVReg > getFConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_FCONSTANT returns it...
Definition: Utils.cpp:421
llvm::MIPatternMatch::CompareOp_match::L
LHS_P L
Definition: MIPatternMatch.h:602
llvm::MIPatternMatch::ConstantMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:81
llvm::MIPatternMatch::bind_helper
Definition: MIPatternMatch.h:300
llvm::MIPatternMatch::OneUse_match::SubPat
SubPatternT SubPat
Definition: MIPatternMatch.h:36
llvm::MIPatternMatch::CompareOp_match::CompareOp_match
CompareOp_match(const Pred_P &Pred, const LHS_P &LHS, const RHS_P &RHS)
Definition: MIPatternMatch.h:605
llvm::MIPatternMatch::SpecificConstantOrSplatMatch::SpecificConstantOrSplatMatch
SpecificConstantOrSplatMatch(int64_t RequestedVal)
Definition: MIPatternMatch.h:214
llvm::Pattern
Definition: FileCheckImpl.h:614
llvm::MIPatternMatch::bind_helper< const ConstantFP * >::bind
static bool bind(const MachineRegisterInfo &MRI, const ConstantFP *&F, Register Reg)
Definition: MIPatternMatch.h:332
llvm::MIPatternMatch::m_GFPTrunc
UnaryOp_match< SrcTy, TargetOpcode::G_FPTRUNC > m_GFPTrunc(const SrcTy &Src)
Definition: MIPatternMatch.h:573
llvm::MIPatternMatch::m_GBitcast
UnaryOp_match< SrcTy, TargetOpcode::G_BITCAST > m_GBitcast(const SrcTy &Src)
Definition: MIPatternMatch.h:555
llvm::MIPatternMatch::operand_type_match
}
Definition: MIPatternMatch.h:245
llvm::getFConstantSplat
Optional< FPValueAndVReg > getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI, bool AllowUndef=true)
Returns a floating point scalar constant of a build vector splat if it exists.
Definition: Utils.cpp:1105
llvm::MIPatternMatch::SpecificConstantSplatMatch::SpecificConstantSplatMatch
SpecificConstantSplatMatch(int64_t RequestedVal)
Definition: MIPatternMatch.h:198
llvm::MachineInstr::getNumOperands
unsigned getNumOperands() const
Retuns the total number of operands.
Definition: MachineInstr.h:494
llvm::MIPatternMatch::m_GFMul
BinaryOp_match< LHS, RHS, TargetOpcode::G_FMUL, true > m_GFMul(const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:452
llvm::MIPatternMatch::m_Neg
BinaryOp_match< SpecificConstantMatch, SrcTy, TargetOpcode::G_SUB > m_Neg(const SrcTy &&Src)
Matches a register negated by a G_SUB.
Definition: MIPatternMatch.h:688
llvm::MIPatternMatch::OneUse_match
Definition: MIPatternMatch.h:35
llvm::MIPatternMatch::GFCstOrSplatGFCstMatch::GFCstOrSplatGFCstMatch
GFCstOrSplatGFCstMatch(Optional< FPValueAndVReg > &FPValReg)
Definition: MIPatternMatch.h:167
llvm::MIPatternMatch::BinaryOp_match::BinaryOp_match
BinaryOp_match(const LHS_P &LHS, const RHS_P &RHS)
Definition: MIPatternMatch.h:367
llvm::isBuildVectorConstantSplat
bool isBuildVectorConstantSplat(const Register Reg, const MachineRegisterInfo &MRI, int64_t SplatValue, bool AllowUndef)
Return true if the specified register is defined by G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all ...
Definition: Utils.cpp:1058
llvm::MIPatternMatch::bind_helper< MachineInstr * >::bind
static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI, MachineInstr *Inst)
Definition: MIPatternMatch.h:315
llvm::getConstantFPVRegVal
const ConstantFP * getConstantFPVRegVal(Register VReg, const MachineRegisterInfo &MRI)
Definition: Utils.cpp:432
llvm::MIPatternMatch::m_all_of
And< Preds... > m_all_of(Preds &&... preds)
Definition: MIPatternMatch.h:292
llvm::MIPatternMatch::CheckType::Ty
LLT Ty
Definition: MIPatternMatch.h:638
llvm::MIPatternMatch::GCstAndRegMatch::ValReg
Optional< ValueAndVReg > & ValReg
Definition: MIPatternMatch.h:140
llvm::MIPatternMatch::m_Not
BinaryOp_match< SrcTy, SpecificConstantMatch, TargetOpcode::G_XOR, true > m_Not(const SrcTy &&Src)
Matches a register not-ed by a G_XOR.
Definition: MIPatternMatch.h:696
llvm::MIPatternMatch::OneUse_match::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:39
llvm::MIPatternMatch::mi_match
bool mi_match(Reg R, const MachineRegisterInfo &MRI, Pattern &&P)
Definition: MIPatternMatch.h:25
llvm::MIPatternMatch::TernaryOp_match
Definition: MIPatternMatch.h:649
llvm::MIPatternMatch::m_BinOp
BinaryOpc_match< LHS, RHS, false > m_BinOp(unsigned Opcode, const LHS &L, const RHS &R)
Definition: MIPatternMatch.h:409
llvm::MIPatternMatch::TernaryOp_match::Src0
Src0Ty Src0
Definition: MIPatternMatch.h:650
llvm::MIPatternMatch::m_GInsertVecElt
TernaryOp_match< Src0Ty, Src1Ty, Src2Ty, TargetOpcode::G_INSERT_VECTOR_ELT > m_GInsertVecElt(const Src0Ty &Src0, const Src1Ty &Src1, const Src2Ty &Src2)
Definition: MIPatternMatch.h:672
llvm::MIPatternMatch::GFCstAndRegMatch
Definition: MIPatternMatch.h:152
llvm::MIPatternMatch::m_OneUse
OneUse_match< SubPat > m_OneUse(const SubPat &SP)
Definition: MIPatternMatch.h:45
llvm::MIPatternMatch::SpecificConstantMatch
Matcher for a specific constant value.
Definition: MIPatternMatch.h:181
llvm::MIPatternMatch::ICstOrSplatMatch::match
bool match(const MachineRegisterInfo &MRI, Register Reg)
Definition: MIPatternMatch.h:116
llvm::MIPatternMatch::ConstantMatch::CR
ConstT & CR
Definition: MIPatternMatch.h:79
llvm::MIPatternMatch::SpecificConstantSplatMatch
Matcher for a specific constant splat.
Definition: MIPatternMatch.h:196
llvm::MIPatternMatch::And< Pred, Preds... >::And
And(Pred &&p, Preds &&... preds)
Definition: MIPatternMatch.h:265
llvm::MIPatternMatch::CompareOp_match::R
RHS_P R
Definition: MIPatternMatch.h:603
llvm::LLT
Definition: LowLevelTypeImpl.h:39