28#ifndef LLVM_IR_PATTERNMATCH_H
29#define LLVM_IR_PATTERNMATCH_H
50template <
typename Val,
typename Pattern>
bool match(Val *V,
const Pattern &
P) {
56template <
typename Val = const Value,
typename Pattern>
70 template <
typename OpTy>
bool match(OpTy *V)
const {
85 template <
typename OpTy>
bool match(OpTy *V)
const {
172 for (
const Value *
Op : CA->operand_values()) {
179 if (Seen.
insert(CA).second)
189 while (!Worklist.
empty()) {
195 template <
typename ITy>
bool match(ITy *V)
const {
return check(V); }
227 template <
typename ITy>
bool match(ITy *V)
const {
241 template <
typename OpTy>
bool match(OpTy *V)
const {
243 auto *
Splat =
C->getSplatValue();
268 template <
typename ITy>
bool match(ITy *V)
const {
return !
M.match(V); }
283 template <
typename ITy>
bool match(ITy *V)
const {
298 template <
typename ITy>
bool match(ITy *V)
const {
307template <
typename LTy,
typename RTy>
313template <
typename LTy,
typename RTy>
319 static_assert(std::is_same_v<APTy, APInt> || std::is_same_v<APTy, APFloat>);
329 template <
typename ITy>
bool match(ITy *V)
const {
331 Res = &CI->getValue();
334 if (V->getType()->isVectorTy())
338 Res = &CI->getValue();
380 template <
typename ITy>
bool match(ITy *V)
const {
382 const APInt &CIV = CI->getValue();
384 return CIV ==
static_cast<uint64_t>(Val);
403template <
typename Predicate,
typename ConstantVal,
bool AllowPoison>
408 return this->isValue(CV->getValue());
412 return this->isValue(CV->getValue());
420 unsigned NumElts = FVTy->getNumElements();
421 assert(NumElts != 0 &&
"Constant vector with no elements?");
422 bool HasNonPoisonElements =
false;
423 for (
unsigned i = 0; i != NumElts; ++i) {
424 Constant *Elt =
C->getAggregateElement(i);
430 if (!CV || !this->isValue(CV->getValue()))
432 HasNonPoisonElements =
true;
434 return HasNonPoisonElements;
440 template <
typename ITy>
bool match(ITy *V)
const {
451template <
typename Predicate,
bool AllowPoison = true>
455template <
typename Predicate>
461template <
typename Predicate>
struct api_pred_ty :
public Predicate {
466 template <
typename ITy>
bool match(ITy *V)
const {
468 if (this->isValue(CI->getValue())) {
469 Res = &CI->getValue();
472 if (V->getType()->isVectorTy())
475 C->getSplatValue(
true)))
476 if (this->isValue(CI->getValue())) {
477 Res = &CI->getValue();
488template <
typename Predicate>
struct apf_pred_ty :
public Predicate {
493 template <
typename ITy>
bool match(ITy *V)
const {
495 if (this->isValue(CI->getValue())) {
496 Res = &CI->getValue();
499 if (V->getType()->isVectorTy())
502 C->getSplatValue(
true)))
503 if (this->isValue(CI->getValue())) {
504 Res = &CI->getValue();
661 template <
typename ITy>
bool match(ITy *V)
const {
856 return !
C.isDenormal() &&
C.isNonZero();
873 template <
typename ITy>
bool match(ITy *V)
const {
890 template <
typename ITy>
bool match(ITy *V)
const {
892 if (CV &&
Match.match(V)) {
905template <
typename MatchTy>
907 const MatchTy &Match) {
912template <
typename MatchTy>
914 const MatchTy &Match) {
925template <
typename MatchTy>
930template <
typename MatchTy>
989 if (CV->getType()->isVectorTy()) {
990 if (
auto *
Splat = CV->getSplatValue(
true)) {
992 !
Splat->containsConstantExpression()) {
1014 template <
typename ITy>
bool match(ITy *V)
const {
1034 template <
typename ITy>
bool match(ITy *V)
const {
return V ==
Val; }
1047 template <
typename ITy>
bool match(ITy *
const V)
const {
return V ==
Val; }
1068 template <
typename ITy>
bool match(ITy *V)
const {
1070 return CFP->isExactlyValue(
Val);
1071 if (V->getType()->isVectorTy())
1074 return CFP->isExactlyValue(
Val);
1091 template <
typename ITy>
bool match(ITy *V)
const {
1092 const APInt *ConstInt;
1095 std::optional<uint64_t> ZExtVal = ConstInt->
tryZExtValue();
1110 template <
typename ITy>
bool match(ITy *V)
const {
1112 if (!CI && V->getType()->isVectorTy())
1125 template <
typename ITy>
bool match(ITy *V)
const {
1127 if (!CI && V->getType()->isVectorTy())
1131 return CI && CI->getValue() ==
Val;
1163 template <
typename ITy>
bool match(ITy *V)
const {
1165 return BB && BB ==
Val;
1186template <
typename LHS_t,
typename RHS_t,
bool Commutable = false>
1195 template <
typename OpTy>
bool match(OpTy *V)
const {
1197 return (
L.match(
I->getOperand(0)) &&
R.match(
I->getOperand(1))) ||
1198 (Commutable &&
L.match(
I->getOperand(1)) &&
1199 R.match(
I->getOperand(0)));
1204template <
typename LHS,
typename RHS>
1218 template <
typename OpTy>
bool match(OpTy *V)
const {
1220 return X.match(
I->getOperand(0));
1233template <
typename LHS_t,
typename RHS_t,
unsigned Opcode,
1234 bool Commutable =
false>
1243 template <
typename OpTy>
inline bool match(
unsigned Opc, OpTy *V)
const {
1244 if (V->getValueID() == Value::InstructionVal +
Opc) {
1246 return (
L.match(
I->getOperand(0)) &&
R.match(
I->getOperand(1))) ||
1247 (Commutable &&
L.match(
I->getOperand(1)) &&
1248 R.match(
I->getOperand(0)));
1253 template <
typename OpTy>
bool match(OpTy *V)
const {
1254 return match(Opcode, V);
1258template <
typename LHS,
typename RHS>
1264template <
typename LHS,
typename RHS>
1270template <
typename LHS,
typename RHS>
1276template <
typename LHS,
typename RHS>
1286 template <
typename OpTy>
bool match(OpTy *V)
const {
1291 if (FPMO->getOpcode() == Instruction::FNeg)
1292 return X.match(FPMO->getOperand(0));
1294 if (FPMO->getOpcode() == Instruction::FSub) {
1295 if (FPMO->hasNoSignedZeros()) {
1305 return X.match(FPMO->getOperand(1));
1318template <
typename RHS>
1324template <
typename LHS,
typename RHS>
1330template <
typename LHS,
typename RHS>
1336template <
typename LHS,
typename RHS>
1342template <
typename LHS,
typename RHS>
1348template <
typename LHS,
typename RHS>
1354template <
typename LHS,
typename RHS>
1360template <
typename LHS,
typename RHS>
1366template <
typename LHS,
typename RHS>
1372template <
typename LHS,
typename RHS>
1378template <
typename LHS,
typename RHS>
1384template <
typename LHS,
typename RHS>
1390template <
typename LHS,
typename RHS>
1396template <
typename LHS,
typename RHS>
1402template <
typename LHS,
typename RHS>
1414 template <
typename OpTy>
bool match(OpTy *V)
const {
1416 if (
Op->getOpcode() == Opcode)
1418 L.match(
Op->getOperand(0));
1427template <
typename LHS>
1434template <
typename LHS>
1441template <
typename LHS>
1447template <
typename LHS_t,
typename RHS_t,
unsigned Opcode,
1448 unsigned WrapFlags = 0,
bool Commutable =
false>
1456 template <
typename OpTy>
bool match(OpTy *V)
const {
1458 if (
Op->getOpcode() != Opcode)
1461 !
Op->hasNoUnsignedWrap())
1464 !
Op->hasNoSignedWrap())
1466 return (
L.match(
Op->getOperand(0)) &&
R.match(
Op->getOperand(1))) ||
1467 (Commutable &&
L.match(
Op->getOperand(1)) &&
1468 R.match(
Op->getOperand(0)));
1474template <
typename LHS,
typename RHS>
1482template <
typename LHS,
typename RHS>
1490template <
typename LHS,
typename RHS>
1498template <
typename LHS,
typename RHS>
1506template <
typename LHS,
typename RHS>
1515template <
typename LHS,
typename RHS>
1524template <
typename LHS,
typename RHS>
1533template <
typename LHS,
typename RHS>
1541template <
typename LHS,
typename RHS>
1549template <
typename LHS,
typename RHS>
1558template <
typename LHS_t,
typename RHS_t,
bool Commutable = false>
1566 template <
typename OpTy>
bool match(OpTy *V)
const {
1572template <
typename LHS,
typename RHS>
1578template <
typename LHS,
typename RHS,
bool Commutable = false>
1585 template <
typename OpTy>
bool match(OpTy *V)
const {
1587 assert(PDI->getOpcode() == Instruction::Or &&
"Only or can be disjoint");
1588 if (!PDI->isDisjoint())
1590 return (
L.match(PDI->getOperand(0)) &&
R.match(PDI->getOperand(1))) ||
1591 (Commutable &&
L.match(PDI->getOperand(1)) &&
1592 R.match(PDI->getOperand(0)));
1598template <
typename LHS,
typename RHS>
1603template <
typename LHS,
typename RHS>
1610template <
typename LHS,
typename RHS>
1618template <
typename LHS,
typename RHS>
1628template <
typename LHS,
typename RHS>
1637template <
typename LHS,
typename RHS>
1644 template <
typename OpTy>
bool match(OpTy *V)
const {
1646 if (
Op->getOpcode() == Instruction::Sub &&
Op->hasNoUnsignedWrap() &&
1649 else if (
Op->getOpcode() != Instruction::Xor)
1651 return (
L.match(
Op->getOperand(0)) &&
R.match(
Op->getOperand(1))) ||
1652 (
L.match(
Op->getOperand(1)) &&
R.match(
Op->getOperand(0)));
1660template <
typename LHS,
typename RHS>
1669 bool Commutable =
false>
1676 template <
typename OpTy>
bool match(OpTy *V)
const {
1678 return this->isOpType(
I->getOpcode()) &&
1679 ((
L.match(
I->getOperand(0)) &&
R.match(
I->getOperand(1))) ||
1680 (Commutable &&
L.match(
I->getOperand(1)) &&
1681 R.match(
I->getOperand(0))));
1692 return Opcode == Instruction::LShr || Opcode == Instruction::AShr;
1698 return Opcode == Instruction::LShr || Opcode == Instruction::Shl;
1710 return Opcode == Instruction::SDiv || Opcode == Instruction::UDiv;
1716 return Opcode == Instruction::SRem || Opcode == Instruction::URem;
1721template <
typename LHS,
typename RHS>
1728template <
typename LHS,
typename RHS>
1735template <
typename LHS,
typename RHS>
1742template <
typename LHS,
typename RHS>
1749template <
typename LHS,
typename RHS>
1756template <
typename LHS,
typename RHS>
1763template <
typename LHS,
typename RHS>
1777 template <
typename OpTy>
bool match(OpTy *V)
const {
1779 return PEO->isExact() &&
SubPattern.match(V);
1792template <
typename LHS_t,
typename RHS_t,
typename Class,
1793 bool Commutable =
false>
1806 template <
typename OpTy>
bool match(OpTy *V)
const {
1808 if (
L.match(
I->getOperand(0)) &&
R.match(
I->getOperand(1))) {
1813 if (Commutable &&
L.match(
I->getOperand(1)) &&
1814 R.match(
I->getOperand(0))) {
1824template <
typename LHS,
typename RHS>
1830template <
typename LHS,
typename RHS>
1832 const LHS &L,
const RHS &R) {
1836template <
typename LHS,
typename RHS>
1838 const LHS &L,
const RHS &R) {
1842template <
typename LHS,
typename RHS>
1847template <
typename LHS,
typename RHS>
1852template <
typename LHS,
typename RHS>
1859template <
typename LHS_t,
typename RHS_t,
typename Class,
1860 bool Commutable =
false>
1869 template <
typename OpTy>
bool match(OpTy *V)
const {
1872 L.match(
I->getOperand(0)) &&
R.match(
I->getOperand(1)))
1874 if constexpr (Commutable) {
1877 L.match(
I->getOperand(1)) &&
R.match(
I->getOperand(0)))
1886template <
typename LHS,
typename RHS>
1892template <
typename LHS,
typename RHS>
1898template <
typename LHS,
typename RHS>
1904template <
typename LHS,
typename RHS>
1920 template <
typename OpTy>
bool match(OpTy *V)
const {
1921 if (V->getValueID() == Value::InstructionVal + Opcode) {
1923 return Op1.match(
I->getOperand(0));
1936 template <
typename OpTy>
bool match(OpTy *V)
const {
1937 if (V->getValueID() == Value::InstructionVal + Opcode) {
1939 return Op1.match(
I->getOperand(0)) &&
Op2.match(
I->getOperand(1));
1946template <
typename T0,
typename T1,
typename T2,
unsigned Opcode,
1947 bool CommutableOp2Op3 =
false>
1956 template <
typename OpTy>
bool match(OpTy *V)
const {
1957 if (V->getValueID() == Value::InstructionVal + Opcode) {
1959 if (!
Op1.match(
I->getOperand(0)))
1961 if (
Op2.match(
I->getOperand(1)) &&
Op3.match(
I->getOperand(2)))
1963 return CommutableOp2Op3 &&
Op2.match(
I->getOperand(2)) &&
1964 Op3.match(
I->getOperand(1));
1980 template <
int Idx,
int Last>
1981 std::enable_if_t<Idx != Last, bool>
1986 template <
int Idx,
int Last>
1987 std::enable_if_t<Idx == Last, bool>
1989 return std::get<Idx>(
Operands).match(
I->getOperand(Idx));
1992 template <
typename OpTy>
bool match(OpTy *V)
const {
1993 if (V->getValueID() == Value::InstructionVal + Opcode) {
1995 return I->getNumOperands() ==
sizeof...(OperandTypes) &&
2003template <
typename Cond,
typename LHS,
typename RHS>
2011template <
int64_t L,
int64_t R,
typename Cond>
2013 Instruction::Select>
2019template <
typename LHS,
typename RHS>
2027template <
typename OpTy>
2033template <
typename Val_t,
typename Elt_t,
typename Idx_t>
2041template <
typename Val_t,
typename Idx_t>
2056 template <
typename OpTy>
bool match(OpTy *V)
const {
2058 return Op1.match(
I->getOperand(0)) &&
Op2.match(
I->getOperand(1)) &&
2059 Mask.match(
I->getShuffleMask());
2076 return all_of(Mask, [](
int Elem) {
return Elem == 0 || Elem == -1; });
2090 const auto *
First =
find_if(Mask, [](
int Elem) {
return Elem != -1; });
2091 if (
First == Mask.end())
2095 [
First](
int Elem) {
return Elem == *
First || Elem == -1; });
2106 template <
typename OpTy>
bool match(OpTy *V)
const {
2108 return GEP &&
GEP->getSourceElementType()->isIntegerTy(8) &&
2115template <
typename V1_t,
typename V2_t>
2121template <
typename V1_t,
typename V2_t,
typename Mask_t>
2128template <
typename OpTy>
2134template <
typename ValueOpTy,
typename Po
interOpTy>
2136m_Store(
const ValueOpTy &ValueOp,
const PointerOpTy &PointerOp) {
2142template <
typename... OperandTypes>
2144 return AnyOps_match<Instruction::GetElementPtr, OperandTypes...>(
Ops...);
2148template <
typename Po
interOpTy,
typename OffsetOpTy>
2163 template <
typename OpTy>
bool match(OpTy *V)
const {
2165 return O->getOpcode() == Opcode &&
Op.match(O->getOperand(0));
2175 template <
typename OpTy>
bool match(OpTy *V)
const {
2177 return Op.match(
I->getOperand(0));
2189 template <
typename OpTy>
bool match(OpTy *V)
const {
2191 return O->getOpcode() == Instruction::PtrToInt &&
2192 DL.getTypeSizeInBits(O->getType()) ==
2193 DL.getTypeSizeInBits(O->getOperand(0)->getType()) &&
2194 Op.match(O->getOperand(0));
2204 template <
typename OpTy>
bool match(OpTy *V)
const {
2206 return I->hasNonNeg() &&
Op.match(
I->getOperand(0));
2216 template <
typename OpTy>
bool match(OpTy *V)
const {
2218 return (
I->getNoWrapKind() & WrapFlags) == WrapFlags &&
2219 Op.match(
I->getOperand(0));
2225template <
typename OpTy>
2236 template <
typename OpTy>
bool match(OpTy *V)
const {
2240 Type *SrcType =
I->getSrcTy();
2241 Type *DstType =
I->getType();
2244 if (SrcType->isVectorTy() != DstType->isVectorTy())
2247 SrcVecTy && SrcVecTy->getElementCount() !=
2250 return Op.match(
I->getOperand(0));
2254template <
typename OpTy>
2260template <
typename OpTy>
2266template <
typename OpTy>
2273template <
typename OpTy>
2285template <
typename OpTy>
2292template <
typename OpTy>
2299template <
typename OpTy>
2305template <
typename OpTy>
2312template <
typename OpTy>
2318template <
typename OpTy>
2325template <
typename OpTy>
2331template <
typename OpTy>
2336template <
typename OpTy>
2341template <
typename OpTy>
2347template <
typename OpTy>
2354template <
typename OpTy>
2360template <
typename OpTy>
2367template <
typename OpTy>
2375template <
typename OpTy>
2391 template <
typename OpTy>
bool match(OpTy *V)
const {
2396 Type *Ty = V->getType();
2397 Value *CondV =
nullptr;
2402 TrueC.match(ConstantInt::get(Ty, 1)) &&
2403 FalseC.match(ConstantInt::get(Ty, 0)))
2410 FalseC.match(ConstantInt::get(Ty, 0)))
2425template <
typename CondTy,
typename LTy,
typename RTy>
2431template <
typename OpTy>
2436template <
typename OpTy>
2441template <
typename OpTy>
2446template <
typename OpTy>
2451template <
typename OpTy>
2456template <
typename OpTy>
2470 template <
typename OpTy>
bool match(OpTy *V)
const {
2472 if (BI->isUnconditional()) {
2473 Succ = BI->getSuccessor(0);
2482template <
typename Cond_t,
typename TrueBlock_t,
typename FalseBlock_t>
2488 brc_match(
const Cond_t &
C,
const TrueBlock_t &t,
const FalseBlock_t &f)
2491 template <
typename OpTy>
bool match(OpTy *V)
const {
2493 if (BI->isConditional() &&
Cond.match(BI->getCondition()))
2494 return T.match(BI->getSuccessor(0)) &&
F.match(BI->getSuccessor(1));
2499template <
typename Cond_t>
2506template <
typename Cond_t,
typename TrueBlock_t,
typename FalseBlock_t>
2508m_Br(
const Cond_t &
C,
const TrueBlock_t &
T,
const FalseBlock_t &
F) {
2516template <
typename CmpInst_t,
typename LHS_t,
typename RHS_t,
typename Pred_t,
2517 bool Commutable =
false>
2527 template <
typename OpTy>
bool match(OpTy *V)
const {
2535 return (
L.match(
LHS) &&
R.match(
RHS)) ||
2536 (Commutable &&
L.match(
RHS) &&
R.match(
LHS));
2548 auto *TrueVal =
SI->getTrueValue();
2549 auto *FalseVal =
SI->getFalseValue();
2550 auto *
LHS = Cmp->getOperand(0);
2551 auto *
RHS = Cmp->getOperand(1);
2552 if ((TrueVal !=
LHS || FalseVal !=
RHS) &&
2553 (TrueVal !=
RHS || FalseVal !=
LHS))
2555 typename CmpInst_t::Predicate Pred =
2556 LHS == TrueVal ? Cmp->getPredicate() : Cmp->getInversePredicate();
2558 if (!Pred_t::match(Pred))
2561 return (
L.match(
LHS) &&
R.match(
RHS)) ||
2562 (Commutable &&
L.match(
RHS) &&
R.match(
LHS));
2622template <
typename LHS,
typename RHS>
2628template <
typename LHS,
typename RHS>
2634template <
typename LHS,
typename RHS>
2640template <
typename LHS,
typename RHS>
2646template <
typename LHS,
typename RHS>
2666template <
typename LHS,
typename RHS>
2681template <
typename LHS,
typename RHS>
2696template <
typename LHS,
typename RHS>
2711template <
typename LHS,
typename RHS>
2722template <
typename LHS,
typename RHS>
2735template <
typename LHS,
typename RHS>
2746template <
typename ValTy>
2752template <
typename ValTy>
2764template <
typename LHS_t,
typename RHS_t,
typename Sum_t>
2773 template <
typename OpTy>
bool match(OpTy *V)
const {
2774 Value *ICmpLHS, *ICmpRHS;
2779 Value *AddLHS, *AddRHS;
2784 if (AddExpr.match(ICmpLHS) && (ICmpRHS == AddLHS || ICmpRHS == AddRHS))
2785 return L.match(AddLHS) &&
R.match(AddRHS) &&
S.match(ICmpLHS);
2789 if (AddExpr.match(ICmpRHS) && (ICmpLHS == AddLHS || ICmpLHS == AddRHS))
2790 return L.match(AddLHS) &&
R.match(AddRHS) &&
S.match(ICmpRHS);
2796 if (XorExpr.match(ICmpLHS))
2797 return L.match(Op1) &&
R.match(ICmpRHS) &&
S.match(ICmpLHS);
2801 if (XorExpr.match(ICmpRHS))
2802 return L.match(Op1) &&
R.match(ICmpLHS) &&
S.match(ICmpRHS);
2811 return L.match(AddLHS) &&
R.match(AddRHS) &&
S.match(ICmpLHS);
2816 return L.match(AddLHS) &&
R.match(AddRHS) &&
S.match(ICmpRHS);
2827template <
typename LHS_t,
typename RHS_t,
typename Sum_t>
2839 template <
typename OpTy>
bool match(OpTy *V)
const {
2842 return Val.match(CI->getArgOperand(
OpI));
2848template <
unsigned OpI,
typename Opnd_t>
2859 template <
typename OpTy>
bool match(OpTy *V)
const {
2862 return F->getIntrinsicID() ==
ID;
2871template <
typename T0 = void,
typename T1 = void,
typename T2 = void,
2872 typename T3 = void,
typename T4 = void,
typename T5 = void,
2873 typename T6 = void,
typename T7 = void,
typename T8 = void,
2874 typename T9 = void,
typename T10 =
void>
2883template <
typename T0,
typename T1,
typename T2>
2888template <
typename T0,
typename T1,
typename T2,
typename T3>
2894template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
2900template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
2914template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
2921template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
2928template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
2934template <Intrinsic::ID IntrID,
typename T0>
2939template <Intrinsic::ID IntrID,
typename T0,
typename T1>
2945template <Intrinsic::ID IntrID,
typename T0,
typename T1,
typename T2>
2959 typename T3,
typename T4>
2968 typename T3,
typename T4,
typename T5>
2971 const T4 &Op4,
const T5 &Op5) {
2977template <
typename Opnd0>
2982template <
typename Opnd0>
2987template <
typename Opnd0>
2992template <
typename Opnd0>
2997template <
typename Opnd0,
typename Opnd1>
3003template <
typename Opnd0,
typename Opnd1>
3009template <
typename Opnd0,
typename Opnd1>
3015template <
typename Opnd0,
typename Opnd1>
3021template <
typename Opnd0,
typename Opnd1>
3027template <
typename Opnd0,
typename Opnd1>
3033template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
3035m_FShl(
const Opnd0 &Op0,
const Opnd1 &Op1,
const Opnd2 &Op2) {
3039template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
3041m_FShr(
const Opnd0 &Op0,
const Opnd1 &Op1,
const Opnd2 &Op2) {
3045template <
typename Opnd0>
3050template <
typename Opnd0,
typename Opnd1>
3056template <
typename Opnd0>
3061template <
typename Opnd0,
typename Opnd1,
typename Opnd2>
3072template <
typename LHS,
typename RHS>
3079template <
typename LHS,
typename RHS>
3085template <
typename LHS,
typename RHS>
3092template <
typename LHS,
typename RHS>
3099template <
typename LHS,
typename RHS>
3106template <
typename LHS,
typename RHS>
3113template <
typename LHS,
typename RHS>
3120template <
typename LHS,
typename RHS>
3127template <
typename LHS,
typename RHS>
3134template <
typename ValTy>
3141template <
typename ValTy>
3150template <
typename LHS,
typename RHS>
3156template <
typename LHS,
typename RHS>
3162template <
typename LHS,
typename RHS>
3168template <
typename LHS,
typename RHS>
3174template <
typename LHS,
typename RHS>
3185template <Intrinsic::ID IntrID,
typename LHS,
typename RHS>
3192 template <
typename OpTy>
bool match(OpTy *V)
const {
3194 if (!
II ||
II->getIntrinsicID() != IntrID)
3196 return (
L.match(
II->getArgOperand(0)) &&
R.match(
II->getArgOperand(1))) ||
3197 (
L.match(
II->getArgOperand(1)) &&
R.match(
II->getArgOperand(0)));
3201template <Intrinsic::ID IntrID,
typename T0,
typename T1>
3208template <
typename LHS,
typename RHS>
3215template <
typename LHS,
typename RHS>
3225 template <
typename OpTy>
bool match(OpTy *V)
const {
3226 unsigned TypeSize = V->getType()->getScalarSizeInBits();
3230 unsigned ShiftWidth =
TypeSize - 1;
3247 return Signum.match(V) &&
Val.match(
Op);
3265 template <
typename OpTy>
bool match(OpTy *V)
const {
3269 !(
I->getNumIndices() == 1 &&
I->getIndices()[0] == (
unsigned)Ind))
3271 return Val.match(
I->getAggregateOperand());
3279template <
int Ind,
typename Val_t>
3286template <
typename Val_t>
3298 template <
typename OpTy>
bool match(OpTy *V)
const {
3300 return Op0.match(
I->getOperand(0)) &&
Op1.match(
I->getOperand(1)) &&
3301 I->getNumIndices() == 1 && Ind ==
I->getIndices()[0];
3308template <
int Ind,
typename Val_t,
typename Elt_t>
3317template <
typename Opnd0,
typename Opnd1>
3323template <
typename Opnd>
3328template <
typename LHS,
typename RHS,
unsigned Opcode,
bool Commutable = false>
3335 template <
typename T>
bool match(
T *V)
const {
3337 if (!
I || !
I->getType()->isIntOrIntVectorTy(1))
3340 if (
I->getOpcode() == Opcode) {
3341 auto *Op0 =
I->getOperand(0);
3342 auto *Op1 =
I->getOperand(1);
3343 return (
L.match(Op0) &&
R.match(Op1)) ||
3344 (Commutable &&
L.match(Op1) &&
R.match(Op0));
3349 auto *TVal =
Select->getTrueValue();
3350 auto *FVal =
Select->getFalseValue();
3357 if (Opcode == Instruction::And) {
3359 if (
C &&
C->isNullValue())
3360 return (
L.match(
Cond) &&
R.match(TVal)) ||
3361 (Commutable &&
L.match(TVal) &&
R.match(
Cond));
3363 assert(Opcode == Instruction::Or);
3365 if (
C &&
C->isOneValue())
3366 return (
L.match(
Cond) &&
R.match(FVal)) ||
3367 (Commutable &&
L.match(FVal) &&
R.match(
Cond));
3377template <
typename LHS,
typename RHS>
3387template <
typename LHS,
typename RHS>
3395template <
typename LHS,
typename RHS>
3405template <
typename LHS,
typename RHS>
3414template <
typename LHS,
typename RHS,
bool Commutable = false>
3425template <
typename LHS,
typename RHS>
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPU Register Bank Select
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file implements a class to represent arbitrary precision integral constant values and operations...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static constexpr unsigned long long mask(BlockVerifier::State S)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< Instruction::BinaryOps, Value * > OffsetOp
Find all possible pairs (BinOp, RHS) that BinOp V, RHS can be simplified.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
MachineInstr unsigned OpIdx
uint64_t IntrinsicInst * II
const SmallVectorImpl< MachineOperand > & Cond
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
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),...
LLVM Basic Block Representation.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ ICMP_SLT
signed less than
@ ICMP_SLE
signed less or equal
@ FCMP_OLT
0 1 0 0 True if ordered and less than
@ FCMP_ULE
1 1 0 1 True if unordered, less than, or equal
@ FCMP_OGT
0 0 1 0 True if ordered and greater than
@ FCMP_OGE
0 0 1 1 True if ordered and greater than or equal
@ ICMP_UGE
unsigned greater or equal
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ FCMP_ULT
1 1 0 0 True if unordered or less than
@ ICMP_ULT
unsigned less than
@ FCMP_UGT
1 0 1 0 True if unordered or greater than
@ FCMP_OLE
0 1 0 1 True if ordered and less than or equal
@ ICMP_SGE
signed greater or equal
@ ICMP_ULE
unsigned less or equal
@ FCMP_UGE
1 0 1 1 True if unordered, greater than, or equal
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...
static LLVM_ABI CmpPredicate get(const CmpInst *Cmp)
Do a ICmpInst::getCmpPredicate() or CmpInst::getPredicate(), as appropriate.
static LLVM_ABI CmpPredicate getSwapped(CmpPredicate P)
Get the swapped predicate of a CmpPredicate.
Base class for aggregate constants (with operands).
A constant value that is initialized with an expression using other constant values.
ConstantFP - Floating Point Values [float, double].
This is the shared class of boolean and integer constants.
This is an important base class in LLVM.
static LLVM_ABI Constant * getAllOnesValue(Type *Ty)
A parsed version of the target data layout string in and methods for querying it.
Convenience struct for specifying and reasoning about fast-math flags.
static LLVM_ABI bool compare(const APInt &LHS, const APInt &RHS, ICmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
bool isBitwiseLogicOp() const
Return true if this is and/or/xor.
A wrapper class for inspecting calls to intrinsic functions.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
'undef' values are things that do not have specified contents.
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
Base class of all SIMD vector types.
Represents an op.with.overflow intrinsic.
An efficient, type-erasing, non-owning reference to a callable.
@ C
The default llvm calling convention, compatible with C.
TwoOps_match< ValueOpTy, PointerOpTy, Instruction::Store > m_Store(const ValueOpTy &ValueOp, const PointerOpTy &PointerOp)
Matches StoreInst.
cst_pred_ty< is_all_ones > m_AllOnes()
Match an integer or vector with all bits set.
class_match< PoisonValue > m_Poison()
Match an arbitrary poison constant.
cst_pred_ty< is_lowbit_mask > m_LowBitMask()
Match an integer or vector with only the low bit(s) set.
BinaryOp_match< LHS, RHS, Instruction::And > m_And(const LHS &L, const RHS &R)
PtrAdd_match< PointerOpTy, OffsetOpTy > m_PtrAdd(const PointerOpTy &PointerOp, const OffsetOpTy &OffsetOp)
Matches GEP with i8 source element type.
cst_pred_ty< is_negative > m_Negative()
Match an integer or vector of negative values.
ShiftLike_match< LHS, Instruction::LShr > m_LShrOrSelf(const LHS &L, uint64_t &R)
Matches lshr L, ConstShAmt or L itself (R will be set to zero in this case).
AllowFmf_match< T, FastMathFlags::NoSignedZeros > m_NoSignedZeros(const T &SubPattern)
BinaryOp_match< cst_pred_ty< is_all_ones, false >, ValTy, Instruction::Xor, true > m_NotForbidPoison(const ValTy &V)
MaxMin_match< FCmpInst, LHS, RHS, ufmin_pred_ty > m_UnordFMin(const LHS &L, const RHS &R)
Match an 'unordered' floating point minimum function.
PtrToIntSameSize_match< OpTy > m_PtrToIntSameSize(const DataLayout &DL, const OpTy &Op)
BinaryOp_match< LHS, RHS, Instruction::Add > m_Add(const LHS &L, const RHS &R)
class_match< BinaryOperator > m_BinOp()
Match an arbitrary binary operation and ignore it.
m_Intrinsic_Ty< Opnd0 >::Ty m_FCanonicalize(const Opnd0 &Op0)
CmpClass_match< LHS, RHS, FCmpInst > m_FCmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
AllowFmf_match< T, FastMathFlags::NoInfs > m_NoInfs(const T &SubPattern)
BinaryOp_match< LHS, RHS, Instruction::FMul, true > m_c_FMul(const LHS &L, const RHS &R)
Matches FMul with LHS and RHS in either order.
cst_pred_ty< is_sign_mask > m_SignMask()
Match an integer or vector with only the sign bit(s) set.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWAdd(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, Instruction::AShr > m_AShr(const LHS &L, const RHS &R)
auto m_PtrToIntOrAddr(const OpTy &Op)
Matches PtrToInt or PtrToAddr.
cstfp_pred_ty< is_inf > m_Inf()
Match a positive or negative infinity FP constant.
m_Intrinsic_Ty< Opnd0 >::Ty m_BitReverse(const Opnd0 &Op0)
BinaryOp_match< LHS, RHS, Instruction::FSub > m_FSub(const LHS &L, const RHS &R)
cst_pred_ty< is_power2 > m_Power2()
Match an integer or vector power-of-2.
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedStore(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
Matches MaskedStore Intrinsic.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap, true > m_c_NSWAdd(const LHS &L, const RHS &R)
BinaryOp_match< cstfp_pred_ty< is_any_zero_fp >, RHS, Instruction::FSub > m_FNegNSZ(const RHS &X)
Match 'fneg X' as 'fsub +-0.0, X'.
BinaryOp_match< LHS, RHS, Instruction::URem > m_URem(const LHS &L, const RHS &R)
match_combine_or< CastInst_match< OpTy, CastInst >, OpTy > m_CastOrSelf(const OpTy &Op)
Matches any cast or self. Used to ignore casts.
match_combine_or< CastInst_match< OpTy, TruncInst >, OpTy > m_TruncOrSelf(const OpTy &Op)
auto m_LogicalOp()
Matches either L && R or L || R where L and R are arbitrary values.
CommutativeBinaryIntrinsic_match< IntrID, T0, T1 > m_c_Intrinsic(const T0 &Op0, const T1 &Op1)
class_match< Constant > m_Constant()
Match an arbitrary Constant and ignore it.
OneOps_match< OpTy, Instruction::Freeze > m_Freeze(const OpTy &Op)
Matches FreezeInst.
ap_match< APInt > m_APInt(const APInt *&Res)
Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.
BinaryOp_match< LHS, RHS, Instruction::And, true > m_c_And(const LHS &L, const RHS &R)
Matches an And with LHS and RHS in either order.
ap_match< APFloat > m_APFloatForbidPoison(const APFloat *&Res)
Match APFloat while forbidding poison in splat vector constants.
cst_pred_ty< is_power2_or_zero > m_Power2OrZero()
Match an integer or vector of 0 or power-of-2 values.
CastInst_match< OpTy, TruncInst > m_Trunc(const OpTy &Op)
Matches Trunc.
BinaryOp_match< LHS, RHS, Instruction::Xor > m_Xor(const LHS &L, const RHS &R)
br_match m_UnconditionalBr(BasicBlock *&Succ)
CastOperator_match< OpTy, Instruction::PtrToAddr > m_PtrToAddr(const OpTy &Op)
Matches PtrToAddr.
ap_match< APInt > m_APIntAllowPoison(const APInt *&Res)
Match APInt while allowing poison in splat vector constants.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrap > m_NSWSub(const LHS &L, const RHS &R)
specific_intval< false > m_SpecificInt(const APInt &V)
Match a specific integer value or vector with all elements equal to the value.
BinaryOp_match< LHS, RHS, Instruction::FMul > m_FMul(const LHS &L, const RHS &R)
match_combine_or< CastInst_match< OpTy, ZExtInst >, OpTy > m_ZExtOrSelf(const OpTy &Op)
bool match(Val *V, const Pattern &P)
BinOpPred_match< LHS, RHS, is_idiv_op > m_IDiv(const LHS &L, const RHS &R)
Matches integer division operations.
class_match< IntrinsicInst > m_AnyIntrinsic()
Matches any intrinsic call and ignore it.
cst_pred_ty< is_shifted_mask > m_ShiftedMask()
bind_ty< Instruction > m_Instruction(Instruction *&I)
Match an instruction, capturing it if we match.
cstval_pred_ty< Predicate, ConstantInt, AllowPoison > cst_pred_ty
specialization of cstval_pred_ty for ConstantInt
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaxNum(const Opnd0 &Op0, const Opnd1 &Op1)
cstfp_pred_ty< is_any_zero_fp > m_AnyZeroFP()
Match a floating-point negative zero or positive zero.
specificval_ty m_Specific(const Value *V)
Match if we have a specific specified value.
DisjointOr_match< LHS, RHS > m_DisjointOr(const LHS &L, const RHS &R)
constantexpr_match m_ConstantExpr()
Match a constant expression or a constant that contains a constant expression.
BinOpPred_match< LHS, RHS, is_right_shift_op > m_Shr(const LHS &L, const RHS &R)
Matches logical shift operations.
auto m_c_XorLike(const LHS &L, const RHS &R)
Match either (xor L, R), (xor R, L) or (sub nuw R, L) iff R.isMask() Only commutative matcher as the ...
specific_intval< true > m_SpecificIntAllowPoison(const APInt &V)
ap_match< APFloat > m_APFloat(const APFloat *&Res)
Match a ConstantFP or splatted ConstantVector, binding the specified pointer to the contained APFloat...
ap_match< APFloat > m_APFloatAllowPoison(const APFloat *&Res)
Match APFloat while allowing poison in splat vector constants.
CmpClass_match< LHS, RHS, ICmpInst, true > m_c_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
Matches an ICmp with a predicate over LHS and RHS in either order.
auto match_fn(const Pattern &P)
A match functor that can be used as a UnaryPredicate in functional algorithms like all_of.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap, true > m_c_NUWAdd(const LHS &L, const RHS &R)
OverflowingBinaryOp_match< cst_pred_ty< is_zero_int >, ValTy, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrap > m_NSWNeg(const ValTy &V)
Matches a 'Neg' as 'sub nsw 0, V'.
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedLoad(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
Matches MaskedLoad Intrinsic.
TwoOps_match< Val_t, Idx_t, Instruction::ExtractElement > m_ExtractElt(const Val_t &Val, const Idx_t &Idx)
Matches ExtractElementInst.
cstfp_pred_ty< is_finite > m_Finite()
Match a finite FP constant, i.e.
cst_pred_ty< is_nonnegative > m_NonNegative()
Match an integer or vector of non-negative values.
class_match< ConstantInt > m_ConstantInt()
Match an arbitrary ConstantInt and ignore it.
auto m_LogicalOp(const LHS &L, const RHS &R)
Matches either L && R or L || R, either one being in the either binary or logical form.
cst_pred_ty< is_one > m_One()
Match an integer 1 or a vector with all elements equal to 1.
IntrinsicID_match m_Intrinsic()
Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_Value(X))
ThreeOps_match< Cond, LHS, RHS, Instruction::Select > m_Select(const Cond &C, const LHS &L, const RHS &R)
Matches SelectInst.
IntrinsicID_match m_VScale()
Matches a call to llvm.vscale().
cstfp_pred_ty< is_neg_zero_fp > m_NegZeroFP()
Match a floating-point negative zero.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinimum(const Opnd0 &Op0, const Opnd1 &Op1)
match_combine_or< CastInst_match< OpTy, SExtInst >, OpTy > m_SExtOrSelf(const OpTy &Op)
InsertValue_match< Ind, Val_t, Elt_t > m_InsertValue(const Val_t &Val, const Elt_t &Elt)
Matches a single index InsertValue instruction.
match_combine_or< MaxMin_match< FCmpInst, LHS, RHS, ofmin_pred_ty >, MaxMin_match< FCmpInst, LHS, RHS, ufmin_pred_ty > > m_OrdOrUnordFMin(const LHS &L, const RHS &R)
Match an 'ordered' or 'unordered' floating point minimum function.
specific_fpval m_SpecificFP(double V)
Match a specific floating point value or vector with all elements equal to the value.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_Interleave2(const Opnd0 &Op0, const Opnd1 &Op1)
ExtractValue_match< Ind, Val_t > m_ExtractValue(const Val_t &V)
Match a single index ExtractValue instruction.
BinOpPred_match< LHS, RHS, is_logical_shift_op > m_LogicalShift(const LHS &L, const RHS &R)
Matches logical shift operations.
match_combine_and< LTy, RTy > m_CombineAnd(const LTy &L, const RTy &R)
Combine two pattern matchers matching L && R.
MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty > m_SMin(const LHS &L, const RHS &R)
cst_pred_ty< is_any_apint > m_AnyIntegralConstant()
Match an integer or vector with any integral constant.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaximum(const Opnd0 &Op0, const Opnd1 &Op1)
CastInst_match< OpTy, FPToUIInst > m_FPToUI(const OpTy &Op)
m_Intrinsic_Ty< Opnd0 >::Ty m_Sqrt(const Opnd0 &Op0)
ShiftLike_match< LHS, Instruction::Shl > m_ShlOrSelf(const LHS &L, uint64_t &R)
Matches shl L, ConstShAmt or L itself (R will be set to zero in this case).
bind_ty< WithOverflowInst > m_WithOverflowInst(WithOverflowInst *&I)
Match a with overflow intrinsic, capturing it if we match.
BinaryOp_match< LHS, RHS, Instruction::Xor, true > m_c_Xor(const LHS &L, const RHS &R)
Matches an Xor with LHS and RHS in either order.
BinaryOp_match< LHS, RHS, Instruction::FAdd > m_FAdd(const LHS &L, const RHS &R)
SpecificCmpClass_match< LHS, RHS, CmpInst > m_SpecificCmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, Instruction::Mul > m_Mul(const LHS &L, const RHS &R)
deferredval_ty< Value > m_Deferred(Value *const &V)
Like m_Specific(), but works if the specific value to match is determined as part of the same match()...
cst_pred_ty< is_zero_int > m_ZeroInt()
Match an integer 0 or a vector with all elements equal to 0.
NoWrapTrunc_match< OpTy, TruncInst::NoSignedWrap > m_NSWTrunc(const OpTy &Op)
Matches trunc nsw.
match_combine_or< match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, SExtInst > >, OpTy > m_ZExtOrSExtOrSelf(const OpTy &Op)
OneUse_match< T > m_OneUse(const T &SubPattern)
NNegZExt_match< OpTy > m_NNegZExt(const OpTy &Op)
MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty, true > m_c_SMin(const LHS &L, const RHS &R)
Matches an SMin with LHS and RHS in either order.
auto m_LogicalOr()
Matches L || R where L and R are arbitrary values.
BinaryOp_match< cst_pred_ty< is_zero_int >, ValTy, Instruction::Sub > m_Neg(const ValTy &V)
Matches a 'Neg' as 'sub 0, V'.
Splat_match< T > m_ConstantSplat(const T &SubPattern)
Match a constant splat. TODO: Extend this to non-constant splats.
TwoOps_match< V1_t, V2_t, Instruction::ShuffleVector > m_Shuffle(const V1_t &v1, const V2_t &v2)
Matches ShuffleVectorInst independently of mask value.
specific_bbval m_SpecificBB(BasicBlock *BB)
Match a specific basic block value.
MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty, true > m_c_UMax(const LHS &L, const RHS &R)
Matches a UMax with LHS and RHS in either order.
auto m_GEP(const OperandTypes &...Ops)
Matches GetElementPtrInst.
ap_match< APInt > m_APIntForbidPoison(const APInt *&Res)
Match APInt while forbidding poison in splat vector constants.
AllowFmf_match< T, FastMathFlags::NoNaNs > m_NoNaNs(const T &SubPattern)
cst_pred_ty< is_strictlypositive > m_StrictlyPositive()
Match an integer or vector of strictly positive values.
cst_pred_ty< is_non_zero_int > m_NonZeroInt()
Match a non-zero integer or a vector with all non-zero elements.
ThreeOps_match< decltype(m_Value()), LHS, RHS, Instruction::Select, true > m_c_Select(const LHS &L, const RHS &R)
Match Select(C, LHS, RHS) or Select(C, RHS, LHS)
CastInst_match< OpTy, FPExtInst > m_FPExt(const OpTy &Op)
OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoSignedWrap > m_NSWShl(const LHS &L, const RHS &R)
class_match< ConstantFP > m_ConstantFP()
Match an arbitrary ConstantFP and ignore it.
cstfp_pred_ty< is_nonnan > m_NonNaN()
Match a non-NaN FP constant.
SpecificCmpClass_match< LHS, RHS, ICmpInst > m_SpecificICmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)
AllowFmf_match< T, FastMathFlags::AllowReassoc > m_AllowReassoc(const T &SubPattern)
OneOps_match< OpTy, Instruction::Load > m_Load(const OpTy &Op)
Matches LoadInst.
CastInst_match< OpTy, ZExtInst > m_ZExt(const OpTy &Op)
Matches ZExt.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWShl(const LHS &L, const RHS &R)
cstfp_pred_ty< is_non_zero_not_denormal_fp > m_NonZeroNotDenormalFP()
Match a floating-point non-zero that is not a denormal.
cst_pred_ty< is_all_ones, false > m_AllOnesForbidPoison()
OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWMul(const LHS &L, const RHS &R)
BinaryOp_match< LHS, RHS, Instruction::UDiv > m_UDiv(const LHS &L, const RHS &R)
BinOpPred_match< LHS, RHS, is_bitwiselogic_op, true > m_c_BitwiseLogic(const LHS &L, const RHS &R)
Matches bitwise logic operations in either order.
class_match< UndefValue > m_UndefValue()
Match an arbitrary UndefValue constant.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaximumNum(const Opnd0 &Op0, const Opnd1 &Op1)
MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty > m_UMax(const LHS &L, const RHS &R)
AllowFmf_match< T, FastMathFlags::ApproxFunc > m_ApproxFunc(const T &SubPattern)
class_match< CmpInst > m_Cmp()
Matches any compare instruction and ignore it.
brc_match< Cond_t, bind_ty< BasicBlock >, bind_ty< BasicBlock > > m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F)
cst_pred_ty< is_negated_power2 > m_NegatedPower2()
Match a integer or vector negated power-of-2.
match_immconstant_ty m_ImmConstant()
Match an arbitrary immediate Constant and ignore it.
cst_pred_ty< is_negated_power2_or_zero > m_NegatedPower2OrZero()
Match a integer or vector negated power-of-2.
auto m_c_LogicalOp(const LHS &L, const RHS &R)
Matches either L && R or L || R with LHS and RHS in either order.
NoWrapTrunc_match< OpTy, TruncInst::NoUnsignedWrap > m_NUWTrunc(const OpTy &Op)
Matches trunc nuw.
ShiftLike_match< LHS, Instruction::AShr > m_AShrOrSelf(const LHS &L, uint64_t &R)
Matches ashr L, ConstShAmt or L itself (R will be set to zero in this case).
cst_pred_ty< custom_checkfn< APInt > > m_CheckedInt(function_ref< bool(const APInt &)> CheckFn)
Match an integer or vector where CheckFn(ele) for each element is true.
SelectLike_match< CondTy, LTy, RTy > m_SelectLike(const CondTy &C, const LTy &TrueC, const RTy &FalseC)
Matches a value that behaves like a boolean-controlled select, i.e.
cst_pred_ty< is_lowbit_mask_or_zero > m_LowBitMaskOrZero()
Match an integer or vector with only the low bit(s) set.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinimumNum(const Opnd0 &Op0, const Opnd1 &Op1)
specific_fpval m_FPOne()
Match a float 1.0 or vector with all elements equal to 1.0.
DisjointOr_match< LHS, RHS, true > m_c_DisjointOr(const LHS &L, const RHS &R)
MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty, true > m_c_UMin(const LHS &L, const RHS &R)
Matches a UMin with LHS and RHS in either order.
BinaryOp_match< LHS, RHS, Instruction::Add, true > m_c_Add(const LHS &L, const RHS &R)
Matches a Add with LHS and RHS in either order.
SpecificCmpClass_match< LHS, RHS, FCmpInst > m_SpecificFCmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)
match_combine_or< BinaryOp_match< LHS, RHS, Instruction::Add >, DisjointOr_match< LHS, RHS > > m_AddLike(const LHS &L, const RHS &R)
Match either "add" or "or disjoint".
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedGather(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
Matches MaskedGather Intrinsic.
CastInst_match< OpTy, UIToFPInst > m_UIToFP(const OpTy &Op)
match_combine_or< MaxMin_match< FCmpInst, LHS, RHS, ofmax_pred_ty >, MaxMin_match< FCmpInst, LHS, RHS, ufmax_pred_ty > > m_OrdOrUnordFMax(const LHS &L, const RHS &R)
Match an 'ordered' or 'unordered' floating point maximum function.
MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty, true > m_c_SMax(const LHS &L, const RHS &R)
Matches an SMax with LHS and RHS in either order.
CastOperator_match< OpTy, Instruction::BitCast > m_BitCast(const OpTy &Op)
Matches BitCast.
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_FShl(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
match_combine_or< match_combine_or< MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty, true >, MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty, true > >, match_combine_or< MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty, true >, MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty, true > > > m_c_MaxOrMin(const LHS &L, const RHS &R)
MaxMin_match< FCmpInst, LHS, RHS, ufmax_pred_ty > m_UnordFMax(const LHS &L, const RHS &R)
Match an 'unordered' floating point maximum function.
cstval_pred_ty< Predicate, ConstantFP, true > cstfp_pred_ty
specialization of cstval_pred_ty for ConstantFP
match_combine_or< CastInst_match< OpTy, SExtInst >, NNegZExt_match< OpTy > > m_SExtLike(const OpTy &Op)
Match either "sext" or "zext nneg".
cstfp_pred_ty< is_finitenonzero > m_FiniteNonZero()
Match a finite non-zero FP constant.
class_match< UnaryOperator > m_UnOp()
Match an arbitrary unary operation and ignore it.
CastInst_match< OpTy, FPToSIInst > m_FPToSI(const OpTy &Op)
BinaryOp_match< LHS, RHS, Instruction::SDiv > m_SDiv(const LHS &L, const RHS &R)
cstfp_pred_ty< custom_checkfn< APFloat > > m_CheckedFp(function_ref< bool(const APFloat &)> CheckFn)
Match a float or vector where CheckFn(ele) for each element is true.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWSub(const LHS &L, const RHS &R)
MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty > m_SMax(const LHS &L, const RHS &R)
cst_pred_ty< is_maxsignedvalue > m_MaxSignedValue()
Match an integer or vector with values having all bits except for the high bit set (0x7f....
MaxMin_match< FCmpInst, LHS, RHS, ofmax_pred_ty > m_OrdFMax(const LHS &L, const RHS &R)
Match an 'ordered' floating point maximum function.
match_combine_or< OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap >, DisjointOr_match< LHS, RHS > > m_NSWAddLike(const LHS &L, const RHS &R)
Match either "add nsw" or "or disjoint".
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
AnyBinaryOp_match< LHS, RHS, true > m_c_BinOp(const LHS &L, const RHS &R)
Matches a BinaryOperator with LHS and RHS in either order.
Signum_match< Val_t > m_Signum(const Val_t &V)
Matches a signum pattern.
OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap > m_NSWAdd(const LHS &L, const RHS &R)
CastInst_match< OpTy, SIToFPInst > m_SIToFP(const OpTy &Op)
BinaryOp_match< LHS, RHS, Instruction::LShr > m_LShr(const LHS &L, const RHS &R)
CmpClass_match< LHS, RHS, ICmpInst > m_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
Argument_match< Opnd_t > m_Argument(const Opnd_t &Op)
Match an argument.
match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, SExtInst > > m_ZExtOrSExt(const OpTy &Op)
Exact_match< T > m_Exact(const T &SubPattern)
FNeg_match< OpTy > m_FNeg(const OpTy &X)
Match 'fneg X' as 'fsub -0.0, X'.
BinOpPred_match< LHS, RHS, is_shift_op > m_Shift(const LHS &L, const RHS &R)
Matches shift operations.
cstfp_pred_ty< is_pos_zero_fp > m_PosZeroFP()
Match a floating-point positive zero.
BinaryOp_match< LHS, RHS, Instruction::FAdd, true > m_c_FAdd(const LHS &L, const RHS &R)
Matches FAdd with LHS and RHS in either order.
LogicalOp_match< LHS, RHS, Instruction::And, true > m_c_LogicalAnd(const LHS &L, const RHS &R)
Matches L && R with LHS and RHS in either order.
BinaryOp_match< LHS, RHS, Instruction::Shl > m_Shl(const LHS &L, const RHS &R)
cstfp_pred_ty< is_non_zero_fp > m_NonZeroFP()
Match a floating-point non-zero.
UAddWithOverflow_match< LHS_t, RHS_t, Sum_t > m_UAddWithOverflow(const LHS_t &L, const RHS_t &R, const Sum_t &S)
Match an icmp instruction checking for unsigned overflow on addition.
BinaryOp_match< LHS, RHS, Instruction::FDiv > m_FDiv(const LHS &L, const RHS &R)
m_Intrinsic_Ty< Opnd0 >::Ty m_VecReverse(const Opnd0 &Op0)
BinOpPred_match< LHS, RHS, is_irem_op > m_IRem(const LHS &L, const RHS &R)
Matches integer remainder operations.
auto m_LogicalAnd()
Matches L && R where L and R are arbitrary values.
MaxMin_match< FCmpInst, LHS, RHS, ofmin_pred_ty > m_OrdFMin(const LHS &L, const RHS &R)
Match an 'ordered' floating point minimum function.
match_combine_or< match_combine_or< MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty >, MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty > >, match_combine_or< MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty >, MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty > > > m_MaxOrMin(const LHS &L, const RHS &R)
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_FShr(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
ThreeOps_match< Cond, constantint_match< L >, constantint_match< R >, Instruction::Select > m_SelectCst(const Cond &C)
This matches a select of two constants, e.g.: m_SelectCst<-1, 0>(m_Value(V))
BinaryOp_match< LHS, RHS, Instruction::FRem > m_FRem(const LHS &L, const RHS &R)
AllowFmf_match< T, FastMathFlags::AllowContract > m_AllowContract(const T &SubPattern)
CastInst_match< OpTy, FPTruncInst > m_FPTrunc(const OpTy &Op)
class_match< BasicBlock > m_BasicBlock()
Match an arbitrary basic block value and ignore it.
BinaryOp_match< LHS, RHS, Instruction::SRem > m_SRem(const LHS &L, const RHS &R)
auto m_Undef()
Match an arbitrary undef constant.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinNum(const Opnd0 &Op0, const Opnd1 &Op1)
cst_pred_ty< is_nonpositive > m_NonPositive()
Match an integer or vector of non-positive values.
cstfp_pred_ty< is_nan > m_NaN()
Match an arbitrary NaN constant.
BinaryOp_match< cst_pred_ty< is_all_ones >, ValTy, Instruction::Xor, true > m_Not(const ValTy &V)
Matches a 'Not' as 'xor V, -1' or 'xor -1, V'.
BinaryOp_match< LHS, RHS, Instruction::Or > m_Or(const LHS &L, const RHS &R)
m_Intrinsic_Ty< Opnd0 >::Ty m_BSwap(const Opnd0 &Op0)
CastInst_match< OpTy, SExtInst > m_SExt(const OpTy &Op)
Matches SExt.
is_zero m_Zero()
Match any null constant or a vector with all elements equal to 0.
BinaryOp_match< LHS, RHS, Instruction::Or, true > m_c_Or(const LHS &L, const RHS &R)
Matches an Or with LHS and RHS in either order.
match_combine_or< OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap >, DisjointOr_match< LHS, RHS > > m_NUWAddLike(const LHS &L, const RHS &R)
Match either "add nuw" or "or disjoint".
CastOperator_match< OpTy, Instruction::IntToPtr > m_IntToPtr(const OpTy &Op)
Matches IntToPtr.
BinOpPred_match< LHS, RHS, is_bitwiselogic_op > m_BitwiseLogic(const LHS &L, const RHS &R)
Matches bitwise logic operations.
LogicalOp_match< LHS, RHS, Instruction::Or, true > m_c_LogicalOr(const LHS &L, const RHS &R)
Matches L || R with LHS and RHS in either order.
ThreeOps_match< Val_t, Elt_t, Idx_t, Instruction::InsertElement > m_InsertElt(const Val_t &Val, const Elt_t &Elt, const Idx_t &Idx)
Matches InsertElementInst.
SpecificCmpClass_match< LHS, RHS, ICmpInst, true > m_c_SpecificICmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)
ElementWiseBitCast_match< OpTy > m_ElementWiseBitCast(const OpTy &Op)
m_Intrinsic_Ty< Opnd0 >::Ty m_FAbs(const Opnd0 &Op0)
BinaryOp_match< LHS, RHS, Instruction::Mul, true > m_c_Mul(const LHS &L, const RHS &R)
Matches a Mul with LHS and RHS in either order.
m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_CopySign(const Opnd0 &Op0, const Opnd1 &Op1)
CastOperator_match< OpTy, Instruction::PtrToInt > m_PtrToInt(const OpTy &Op)
Matches PtrToInt.
m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_VectorInsert(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)
AllowFmf_match< T, FastMathFlags::AllowReciprocal > m_AllowReciprocal(const T &SubPattern)
OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoSignedWrap > m_NSWMul(const LHS &L, const RHS &R)
match_combine_or< match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, TruncInst > >, OpTy > m_ZExtOrTruncOrSelf(const OpTy &Op)
BinaryOp_match< LHS, RHS, Instruction::Sub > m_Sub(const LHS &L, const RHS &R)
MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty > m_UMin(const LHS &L, const RHS &R)
cstfp_pred_ty< is_noninf > m_NonInf()
Match a non-infinity FP constant, i.e.
m_Intrinsic_Ty< Opnd >::Ty m_Deinterleave2(const Opnd &Op)
match_unless< Ty > m_Unless(const Ty &M)
Match if the inner matcher does NOT match.
match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)
Combine two pattern matchers matching L || R.
cst_pred_ty< icmp_pred_with_threshold > m_SpecificInt_ICMP(ICmpInst::Predicate Predicate, const APInt &Threshold)
Match an integer or vector with every element comparing 'pred' (eg/ne/...) to Threshold.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
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.
auto dyn_cast_or_null(const Y &Val)
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...
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
AllowFmf_match(const SubPattern_t &SP)
bool match(OpTy *V) const
AnyBinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
Matches instructions with Opcode and any number of operands.
bool match(OpTy *V) const
std::enable_if_t< Idx==Last, bool > match_operands(const Instruction *I) const
std::enable_if_t< Idx !=Last, bool > match_operands(const Instruction *I) const
std::tuple< OperandTypes... > Operands
AnyOps_match(const OperandTypes &...Ops)
AnyUnaryOp_match(const OP_t &X)
bool match(OpTy *V) const
Argument_match(unsigned OpIdx, const Opnd_t &V)
bool match(OpTy *V) const
BinOpPred_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
BinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
bool match(unsigned Opc, OpTy *V) const
CastInst_match(const Op_t &OpMatch)
bool match(OpTy *V) const
CastOperator_match(const Op_t &OpMatch)
bool match(OpTy *V) const
bool match(OpTy *V) const
CmpClass_match(CmpPredicate &Pred, const LHS_t &LHS, const RHS_t &RHS)
CmpClass_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
CommutativeBinaryIntrinsic_match(const LHS &L, const RHS &R)
DisjointOr_match(const LHS &L, const RHS &R)
bool match(OpTy *V) const
bool match(OpTy *V) const
ElementWiseBitCast_match(const Op_t &OpMatch)
Exact_match(const SubPattern_t &SP)
bool match(OpTy *V) const
FNeg_match(const Op_t &Op)
bool match(OpTy *V) const
Matcher for a single index InsertValue instruction.
InsertValue_match(const T0 &Op0, const T1 &Op1)
bool match(OpTy *V) const
IntrinsicID_match(Intrinsic::ID IntrID)
bool match(OpTy *V) const
LogicalOp_match(const LHS &L, const RHS &R)
MaxMin_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
NNegZExt_match(const Op_t &OpMatch)
bool match(OpTy *V) const
NoWrapTrunc_match(const Op_t &OpMatch)
bool match(OpTy *V) const
Matches instructions with Opcode and three operands.
bool match(OpTy *V) const
OneOps_match(const T0 &Op1)
bool match(OpTy *V) const
OneUse_match(const SubPattern_t &SP)
bool match(OpTy *V) const
OverflowingBinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
PtrAdd_match(const PointerOpTy &PointerOp, const OffsetOpTy &OffsetOp)
PtrToIntSameSize_match(const DataLayout &DL, const Op_t &OpMatch)
bool match(OpTy *V) const
SelectLike_match(const CondTy &C, const LTy &TC, const RTy &FC)
bool match(OpTy *V) const
ShiftLike_match(const LHS_t &LHS, uint64_t &RHS)
bool match(OpTy *V) const
Shuffle_match(const T0 &Op1, const T1 &Op2, const T2 &Mask)
bool match(OpTy *V) const
bool match(OpTy *V) const
Signum_match(const Opnd_t &V)
bool match(OpTy *V) const
SpecificBinaryOp_match(unsigned Opcode, const LHS_t &LHS, const RHS_t &RHS)
bool match(OpTy *V) const
SpecificCmpClass_match(CmpPredicate Pred, const LHS_t &LHS, const RHS_t &RHS)
const CmpPredicate Predicate
bool match(OpTy *V) const
Splat_match(const SubPattern_t &SP)
Matches instructions with Opcode and three operands.
ThreeOps_match(const T0 &Op1, const T1 &Op2, const T2 &Op3)
bool match(OpTy *V) const
Matches instructions with Opcode and three operands.
TwoOps_match(const T0 &Op1, const T1 &Op2)
bool match(OpTy *V) const
bool match(OpTy *V) const
UAddWithOverflow_match(const LHS_t &L, const RHS_t &R, const Sum_t &S)
XorLike_match(const LHS &L, const RHS &R)
bool match(OpTy *V) const
ap_match(const APTy *&Res, bool AllowPoison)
std::conditional_t< std::is_same_v< APTy, APInt >, ConstantInt, ConstantFP > ConstantTy
This helper class is used to match scalar and vector constants that satisfy a specified predicate,...
apf_pred_ty(const APFloat *&R)
This helper class is used to match scalar and vector constants that satisfy a specified predicate,...
api_pred_ty(const APInt *&R)
Check whether the value has the given Class and matches the nested pattern.
bind_and_match_ty(Class *&V, const MatchTy &Match)
bind_const_intval_ty(uint64_t &V)
bind_immconstant_ty(Constant *&V)
bool match(OpTy *V) const
br_match(BasicBlock *&Succ)
brc_match(const Cond_t &C, const TrueBlock_t &t, const FalseBlock_t &f)
bool match(OpTy *V) const
This helper class is used to match constant scalars, vector splats, and fixed width vectors that sati...
bool match_impl(ITy *V) const
bool isValue(const APTy &C) const
function_ref< bool(const APTy &)> CheckFn
Stores a reference to the Value *, not the Value * itself, thus can be used in commutative matchers.
deferredval_ty(Class *const &V)
bool match(ITy *const V) const
bool isValue(const APInt &C) const
static bool isImmConstant(ITy *V)
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APFloat &C) const
bool isOpType(unsigned Opcode) const
bool isValue(const APFloat &C) const
bool isValue(const APFloat &C) const
bool isOpType(unsigned Opcode) const
bool isValue(const APFloat &C) const
bool isOpType(unsigned Opcode) const
bool isOpType(unsigned Opcode) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APFloat &C) const
bool isValue(const APFloat &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APFloat &C) const
bool isValue(const APInt &C) const
bool isValue(const APFloat &C) const
bool isValue(const APFloat &C) const
bool isValue(const APFloat &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APFloat &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isOpType(unsigned Opcode) const
bool isOpType(unsigned Opcode) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
bool isValue(const APInt &C) const
match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2, T3, T4 >::Ty, Argument_match< T5 > > Ty
match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2, T3 >::Ty, Argument_match< T4 > > Ty
match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2 >::Ty, Argument_match< T3 > > Ty
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.
ArrayRef< int > & MaskRef
m_Mask(ArrayRef< int > &MaskRef)
bool match(ArrayRef< int > Mask) const
bool match(ArrayRef< int > Mask) const
m_SpecificMask(ArrayRef< int > Val)
bool match(ArrayRef< int > Mask) const
m_SplatOrPoisonMask(int &SplatIndex)
bool match(ArrayRef< int > Mask) const
match_combine_and(const LTy &Left, const RTy &Right)
match_combine_or(const LTy &Left, const RTy &Right)
match_unless(const Ty &Matcher)
Helper class for identifying ordered max predicates.
static bool match(FCmpInst::Predicate Pred)
Helper class for identifying ordered min predicates.
static bool match(FCmpInst::Predicate Pred)
Helper class for identifying signed max predicates.
static bool match(ICmpInst::Predicate Pred)
Helper class for identifying signed min predicates.
static bool match(ICmpInst::Predicate Pred)
Match a specified basic block value.
specific_bbval(BasicBlock *Val)
Match a specified floating point value or vector of all elements of that value.
specific_intval64(uint64_t V)
Match a specified integer value or vector of all elements of that value.
specific_intval(const APInt &V)
Match a specified Value*.
specificval_ty(const Value *V)
Helper class for identifying unordered max predicates.
static bool match(FCmpInst::Predicate Pred)
Helper class for identifying unordered min predicates.
static bool match(FCmpInst::Predicate Pred)
Helper class for identifying unsigned max predicates.
static bool match(ICmpInst::Predicate Pred)
Helper class for identifying unsigned min predicates.
static bool match(ICmpInst::Predicate Pred)
static bool check(const Value *V)