LLVM: include/llvm/IR/PatternMatch.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28#ifndef LLVM_IR_PATTERNMATCH_H

29#define LLVM_IR_PATTERNMATCH_H

30

44#include

45

46namespace llvm {

48

49template <typename Val, typename Pattern> bool match(Val *V, const Pattern &P) {

50 return P.match(V);

51}

52

58

59

60

61template <typename Val = const Value, typename Pattern>

65

67 return P.match(Mask);

68}

69

72

74

75 template bool match(OpTy *V) const {

76 return V->hasOneUse() && SubPattern.match(V);

77 }

78};

79

81 return SubPattern;

82}

83

86

88

89 template bool match(OpTy *V) const {

91 return I && I->hasAllowReassoc() && SubPattern.match(I);

92 }

93};

94

95template

97 return SubPattern;

98}

99

103

104

106

107

111

112

116

117

119

123 return true;

124

126 if (!CA)

127 return false;

128

131

132

133

134

136 for (const Value *Op : CA->operand_values()) {

138 continue;

139

141 if (!CA)

142 return false;

143 if (Seen.insert(CA).second)

145 }

146

147 return true;

148 };

149

150 if (!CheckValue(CA))

151 return false;

152

153 while (!Worklist.empty()) {

155 return false;

156 }

157 return true;

158 }

159 template bool match(ITy *V) const { return check(V); }

160};

161

162

163

164

166

167

171

172

176

177

179

180

184

185

189

191 template bool match(ITy *V) const {

194 }

195};

196

197

198

200

204

205 template bool match(OpTy *V) const {

207 auto *Splat = C->getSplatValue();

209 }

210

211 return false;

212 }

213};

214

215

216template

218 return SubPattern;

219}

220

221

225

226

229

231

232 template bool match(ITy *V) const { return M.match(V); }

233};

234

235

239

240

244

246

247 template bool match(ITy *V) const {

248 if (L.match(V))

249 return true;

250 if (R.match(V))

251 return true;

252 return false;

253 }

254};

255

259

261

262 template bool match(ITy *V) const {

263 if (L.match(V))

264 if (R.match(V))

265 return true;

266 return false;

267 }

268};

269

270

271template <typename LTy, typename RTy>

275

276

277template <typename LTy, typename RTy>

281

282template struct ap_match {

283 static_assert(std::is_same_v<APTy, APInt> || std::is_same_v<APTy, APFloat>);

286

289

292

293 template bool match(ITy *V) const {

295 Res = &CI->getValue();

296 return true;

297 }

298 if (V->getType()->isVectorTy())

300 if (auto *CI =

302 Res = &CI->getValue();

303 return true;

304 }

305 return false;

306 }

307};

308

309

310

315

316

320

321

325

326

327

332

333

337

338

342

344 template bool match(ITy *V) const {

346 const APInt &CIV = CI->getValue();

347 if (Val >= 0)

348 return CIV == static_cast<uint64_t>(Val);

349

350

351

352 return -CIV == -Val;

353 }

354 return false;

355 }

356};

357

358

362

363

364

365

366

367template <typename Predicate, typename ConstantVal, bool AllowPoison>

370 template bool match_impl(ITy *V) const {

372 return this->isValue(CV->getValue());

376 return this->isValue(CV->getValue());

377

378

380 if (!FVTy)

381 return false;

382

383

384 unsigned NumElts = FVTy->getNumElements();

385 assert(NumElts != 0 && "Constant vector with no elements?");

386 bool HasNonPoisonElements = false;

387 for (unsigned i = 0; i != NumElts; ++i) {

388 Constant *Elt = C->getAggregateElement(i);

389 if (!Elt)

390 return false;

392 continue;

394 if (!CV || !this->isValue(CV->getValue()))

395 return false;

396 HasNonPoisonElements = true;

397 }

398 return HasNonPoisonElements;

399 }

400 }

401 return false;

402 }

403

404 template bool match(ITy *V) const {

408 return true;

409 }

410 return false;

411 }

412};

413

414

415template <typename Predicate, bool AllowPoison = true>

417

418

419template

421 true>;

422

423

424

425template struct api_pred_ty : public Predicate {

427

429

430 template bool match(ITy *V) const {

432 if (this->isValue(CI->getValue())) {

433 Res = &CI->getValue();

434 return true;

435 }

436 if (V->getType()->isVectorTy())

439 C->getSplatValue(true)))

440 if (this->isValue(CI->getValue())) {

441 Res = &CI->getValue();

442 return true;

443 }

444

445 return false;

446 }

447};

448

449

450

451

452template struct apf_pred_ty : public Predicate {

454

456

457 template bool match(ITy *V) const {

459 if (this->isValue(CI->getValue())) {

460 Res = &CI->getValue();

461 return true;

462 }

463 if (V->getType()->isVectorTy())

466 C->getSplatValue( true)))

467 if (this->isValue(CI->getValue())) {

468 Res = &CI->getValue();

469 return true;

470 }

471

472 return false;

473 }

474};

475

476

477

478

479

480

481

482

483

484

489

490

491

496

501

502

503

508

513

517

518

522

526

530

534

535

539

543

547

548

549

556

560

561

566

570

571

576

580

581

588

592

593

598

602

603

605

609

610

614

616 template bool match(ITy *V) const {

618

620 }

621};

622

623

625

629

630

633

637

638

645

649

650

658

662

663

670

674

675

679

683

684

689

693

694

701

709

710

715 P.Thr = &Threshold;

716 return P;

717}

718

722

723

725

729

730

734

738

739

741

745

746

750

754

755

760

764

765

772

776

777

781

785

786

790

794

795

799

803

804

808

811 return C.isDenormal() && C.isNonZero();

812 }

813};

814

815

816

820

821

822

823template struct bind_ty {

825

827

828 template bool match(ITy *V) const {

830 VR = CV;

831 return true;

832 }

833 return false;

834 }

835};

836

837

838

842

844

845 template bool match(ITy *V) const {

847 if (CV && Match.match(V)) {

848 VR = CV;

849 return true;

850 }

851 return false;

852 }

853};

854

855

858

859

860template

862 const MatchTy &Match) {

863 return {V, Match};

864}

865

866

867template

869 const MatchTy &Match) {

870 return {V, Match};

871}

872

873

878

879

880template

883 return {I, Match};

884}

885template

888 return {I, Match};

889}

890

891

896

901

909

910

912

913

915

916

918

919

921

922

924

925

930

931

932

937 return true;

938

939 if (CV->getType()->isVectorTy()) {

940 if (auto *Splat = CV->getSplatValue(true)) {

942 Splat->containsConstantExpression()) {

943 return true;

944 }

945 }

946 }

947 }

948 return false;

949 }

950};

951

955

956

958

961

963

964 template bool match(ITy *V) const {

967 return true;

968 }

969 return false;

970 }

971};

972

973

977

978

981

983

984 template bool match(ITy *V) const { return V == Val; }

985};

986

987

989

990

991

994

996

997 template bool match(ITy *const V) const { return V == Val; }

998};

999

1000

1001

1002

1003

1004

1005

1010

1011

1012

1015

1017

1018 template bool match(ITy *V) const {

1020 return CFP->isExactlyValue(Val);

1021 if (V->getType()->isVectorTy())

1024 return CFP->isExactlyValue(Val);

1025 return false;

1026 }

1027};

1028

1029

1030

1032

1033

1035

1038

1040

1041 template bool match(ITy *V) const {

1042 const APInt *ConstInt;

1044 return false;

1046 return false;

1048 return true;

1049 }

1050};

1051

1052

1053

1056

1058

1059 template bool match(ITy *V) const {

1061 if (!CI && V->getType()->isVectorTy())

1064

1066 }

1067};

1068

1071

1073

1074 template bool match(ITy *V) const {

1076 if (!CI && V->getType()->isVectorTy())

1079

1080 return CI && CI->getValue() == Val;

1081 }

1082};

1083

1084

1085

1089

1093

1097

1101

1102

1103

1105

1106

1109

1111

1112 template bool match(ITy *V) const {

1114 return BB && BB == Val;

1115 }

1116};

1117

1118

1122

1123

1131

1132

1133

1134

1135template <typename LHS_t, typename RHS_t, bool Commutable = false>

1139

1140

1141

1143

1144 template bool match(OpTy *V) const {

1146 return (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) ||

1147 (Commutable && L.match(I->getOperand(1)) &&

1148 R.match(I->getOperand(0)));

1149 return false;

1150 }

1151};

1152

1153template <typename LHS, typename RHS>

1157

1158

1159

1160

1161

1164

1166

1167 template bool match(OpTy *V) const {

1169 return X.match(I->getOperand(0));

1170 return false;

1171 }

1172};

1173

1177

1178

1179

1180

1181

1182template <typename LHS_t, typename RHS_t, unsigned Opcode,

1183 bool Commutable = false>

1187

1188

1189

1191

1192 template inline bool match(unsigned Opc, OpTy *V) const {

1193 if (V->getValueID() == Value::InstructionVal + Opc) {

1195 return (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) ||

1196 (Commutable && L.match(I->getOperand(1)) &&

1197 R.match(I->getOperand(0)));

1198 }

1199 return false;

1200 }

1201

1202 template bool match(OpTy *V) const {

1203 return match(Opcode, V);

1204 }

1205};

1206

1207template <typename LHS, typename RHS>

1209 const RHS &R) {

1211}

1212

1213template <typename LHS, typename RHS>

1215 const RHS &R) {

1217}

1218

1219template <typename LHS, typename RHS>

1221 const RHS &R) {

1223}

1224

1225template <typename LHS, typename RHS>

1227 const RHS &R) {

1229}

1230

1233

1235 template bool match(OpTy *V) const {

1237 if (!FPMO)

1238 return false;

1239

1240 if (FPMO->getOpcode() == Instruction::FNeg)

1241 return X.match(FPMO->getOperand(0));

1242

1243 if (FPMO->getOpcode() == Instruction::FSub) {

1244 if (FPMO->hasNoSignedZeros()) {

1245

1247 return false;

1248 } else {

1249

1251 return false;

1252 }

1253

1254 return X.match(FPMO->getOperand(1));

1255 }

1256

1257 return false;

1258 }

1259};

1260

1261

1265

1266

1267template

1272

1273template <typename LHS, typename RHS>

1275 const RHS &R) {

1277}

1278

1279template <typename LHS, typename RHS>

1281 const RHS &R) {

1283}

1284

1285template <typename LHS, typename RHS>

1287 const RHS &R) {

1289}

1290

1291template <typename LHS, typename RHS>

1293 const RHS &R) {

1295}

1296

1297template <typename LHS, typename RHS>

1299 const RHS &R) {

1301}

1302

1303template <typename LHS, typename RHS>

1305 const RHS &R) {

1307}

1308

1309template <typename LHS, typename RHS>

1311 const RHS &R) {

1313}

1314

1315template <typename LHS, typename RHS>

1317 const RHS &R) {

1319}

1320

1321template <typename LHS, typename RHS>

1323 const RHS &R) {

1325}

1326

1327template <typename LHS, typename RHS>

1329 const RHS &R) {

1331}

1332

1333template <typename LHS, typename RHS>

1335 const RHS &R) {

1337}

1338

1339template <typename LHS, typename RHS>

1341 const RHS &R) {

1343}

1344

1345template <typename LHS, typename RHS>

1347 const RHS &R) {

1349}

1350

1351template <typename LHS, typename RHS>

1353 const RHS &R) {

1355}

1356

1360

1362

1363 template bool match(OpTy *V) const {

1365 if (Op->getOpcode() == Opcode)

1367 L.match(Op->getOperand(0));

1368 }

1369

1370 R = 0;

1371 return L.match(V);

1372 }

1373};

1374

1375

1376template

1381

1382

1383template

1388

1389

1390template

1395

1396template <typename LHS_t, typename RHS_t, unsigned Opcode,

1397 unsigned WrapFlags = 0, bool Commutable = false>

1401

1404

1405 template bool match(OpTy *V) const {

1407 if (Op->getOpcode() != Opcode)

1408 return false;

1410 Op->hasNoUnsignedWrap())

1411 return false;

1413 Op->hasNoSignedWrap())

1414 return false;

1415 return (L.match(Op->getOperand(0)) && R.match(Op->getOperand(1))) ||

1416 (Commutable && L.match(Op->getOperand(1)) &&

1417 R.match(Op->getOperand(0)));

1418 }

1419 return false;

1420 }

1421};

1422

1423template <typename LHS, typename RHS>

1431template <typename LHS, typename RHS>

1439template <typename LHS, typename RHS>

1447template <typename LHS, typename RHS>

1455template <typename LHS, typename RHS>

1463

1464template <typename LHS, typename RHS>

1472

1473template <typename LHS, typename RHS>

1481

1482template <typename LHS, typename RHS>

1490template <typename LHS, typename RHS>

1498template <typename LHS, typename RHS>

1506

1507template <typename LHS_t, typename RHS_t, bool Commutable = false>

1509 : public BinaryOp_match<LHS_t, RHS_t, 0, Commutable> {

1511

1514

1515 template bool match(OpTy *V) const {

1517 }

1518};

1519

1520

1521template <typename LHS, typename RHS>

1523 const RHS &R) {

1525}

1526

1527template <typename LHS, typename RHS, bool Commutable = false>

1531

1533

1534 template bool match(OpTy *V) const {

1536 assert(PDI->getOpcode() == Instruction::Or && "Only or can be disjoint");

1537 if (!PDI->isDisjoint())

1538 return false;

1539 return (L.match(PDI->getOperand(0)) && R.match(PDI->getOperand(1))) ||

1540 (Commutable && L.match(PDI->getOperand(1)) &&

1541 R.match(PDI->getOperand(0)));

1542 }

1543 return false;

1544 }

1545};

1546

1547template <typename LHS, typename RHS>

1551

1552template <typename LHS, typename RHS>

1554 const RHS &R) {

1556}

1557

1558

1559template <typename LHS, typename RHS>

1565

1566

1567template <typename LHS, typename RHS>

1575

1576

1577template <typename LHS, typename RHS>

1585

1586template <typename LHS, typename RHS>

1590

1592

1593 template bool match(OpTy *V) const {

1595 if (Op->getOpcode() == Instruction::Sub && Op->hasNoUnsignedWrap() &&

1597 ;

1598 else if (Op->getOpcode() != Instruction::Xor)

1599 return false;

1600 return (L.match(Op->getOperand(0)) && R.match(Op->getOperand(1))) ||

1601 (L.match(Op->getOperand(1)) && R.match(Op->getOperand(0)));

1602 }

1603 return false;

1604 }

1605};

1606

1607

1608

1609template <typename LHS, typename RHS>

1613

1614

1615

1616

1618 bool Commutable = false>

1622

1624

1625 template bool match(OpTy *V) const {

1627 return this->isOpType(I->getOpcode()) &&

1628 ((L.match(I->getOperand(0)) && R.match(I->getOperand(1))) ||

1629 (Commutable && L.match(I->getOperand(1)) &&

1630 R.match(I->getOperand(0))));

1631 return false;

1632 }

1633};

1634

1638

1641 return Opcode == Instruction::LShr || Opcode == Instruction::AShr;

1642 }

1643};

1644

1647 return Opcode == Instruction::LShr || Opcode == Instruction::Shl;

1648 }

1649};

1650

1656

1659 return Opcode == Instruction::SDiv || Opcode == Instruction::UDiv;

1660 }

1661};

1662

1665 return Opcode == Instruction::SRem || Opcode == Instruction::URem;

1666 }

1667};

1668

1669

1670template <typename LHS, typename RHS>

1672 const RHS &R) {

1674}

1675

1676

1677template <typename LHS, typename RHS>

1679 const RHS &R) {

1681}

1682

1683

1684template <typename LHS, typename RHS>

1689

1690

1691template <typename LHS, typename RHS>

1696

1697

1698template <typename LHS, typename RHS>

1703

1704

1705template <typename LHS, typename RHS>

1707 const RHS &R) {

1709}

1710

1711

1712template <typename LHS, typename RHS>

1714 const RHS &R) {

1716}

1717

1718

1719

1720

1723

1725

1726 template bool match(OpTy *V) const {

1728 return PEO->isExact() && SubPattern.match(V);

1729 return false;

1730 }

1731};

1732

1734 return SubPattern;

1735}

1736

1737

1738

1739

1740

1741template <typename LHS_t, typename RHS_t, typename Class,

1742 bool Commutable = false>

1747

1748

1749

1754

1755 template bool match(OpTy *V) const {

1757 if (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) {

1760 return true;

1761 }

1762 if (Commutable && L.match(I->getOperand(1)) &&

1763 R.match(I->getOperand(0))) {

1766 return true;

1767 }

1768 }

1769 return false;

1770 }

1771};

1772

1773template <typename LHS, typename RHS>

1775 const RHS &R) {

1777}

1778

1779template <typename LHS, typename RHS>

1781 const LHS &L, const RHS &R) {

1783}

1784

1785template <typename LHS, typename RHS>

1787 const LHS &L, const RHS &R) {

1789}

1790

1791template <typename LHS, typename RHS>

1795

1796template <typename LHS, typename RHS>

1800

1801template <typename LHS, typename RHS>

1805

1806

1807

1808template <typename LHS_t, typename RHS_t, typename Class,

1809 bool Commutable = false>

1814

1817

1818 template bool match(OpTy *V) const {

1821 L.match(I->getOperand(0)) && R.match(I->getOperand(1)))

1822 return true;

1823 if constexpr (Commutable) {

1826 L.match(I->getOperand(1)) && R.match(I->getOperand(0)))

1827 return true;

1828 }

1829 }

1830

1831 return false;

1832 }

1833};

1834

1835template <typename LHS, typename RHS>

1840

1841template <typename LHS, typename RHS>

1846

1847template <typename LHS, typename RHS>

1852

1853template <typename LHS, typename RHS>

1858

1859

1860

1861

1862

1863

1864template <typename T0, unsigned Opcode> struct OneOps_match {

1866

1868

1869 template bool match(OpTy *V) const {

1870 if (V->getValueID() == Value::InstructionVal + Opcode) {

1872 return Op1.match(I->getOperand(0));

1873 }

1874 return false;

1875 }

1876};

1877

1878

1879template <typename T0, typename T1, unsigned Opcode> struct TwoOps_match {

1882

1884

1885 template bool match(OpTy *V) const {

1886 if (V->getValueID() == Value::InstructionVal + Opcode) {

1888 return Op1.match(I->getOperand(0)) && Op2.match(I->getOperand(1));

1889 }

1890 return false;

1891 }

1892};

1893

1894

1895template <typename T0, typename T1, typename T2, unsigned Opcode,

1896 bool CommutableOp2Op3 = false>

1901

1904

1905 template bool match(OpTy *V) const {

1906 if (V->getValueID() == Value::InstructionVal + Opcode) {

1908 if (Op1.match(I->getOperand(0)))

1909 return false;

1910 if (Op2.match(I->getOperand(1)) && Op3.match(I->getOperand(2)))

1911 return true;

1912 return CommutableOp2Op3 && Op2.match(I->getOperand(2)) &&

1913 Op3.match(I->getOperand(1));

1914 }

1915 return false;

1916 }

1917};

1918

1919

1920template <unsigned Opcode, typename... OperandTypes> struct AnyOps_match {

1922

1924

1925

1926

1927

1928

1929 template <int Idx, int Last>

1930 std::enable_if_t<Idx != Last, bool>

1934

1935 template <int Idx, int Last>

1936 std::enable_if_t<Idx == Last, bool>

1938 return std::get(Operands).match(I->getOperand(Idx));

1939 }

1940

1941 template bool match(OpTy *V) const {

1942 if (V->getValueID() == Value::InstructionVal + Opcode) {

1944 return I->getNumOperands() == sizeof...(OperandTypes) &&

1946 }

1947 return false;

1948 }

1949};

1950

1951

1952template <typename Cond, typename LHS, typename RHS>

1957

1958

1959

1960template <int64_t L, int64_t R, typename Cond>

1962 Instruction::Select>

1966

1967

1968template <typename LHS, typename RHS>

1974

1975

1976template

1980

1981

1982template <typename Val_t, typename Elt_t, typename Idx_t>

1984m_InsertElt(const Val_t &Val, const Elt_t &Elt, const Idx_t &Idx) {

1986 Val, Elt, Idx);

1987}

1988

1989

1990template <typename Val_t, typename Idx_t>

1995

1996

1997template <typename T0, typename T1, typename T2> struct Shuffle_match {

2001

2004

2005 template bool match(OpTy *V) const {

2007 return Op1.match(I->getOperand(0)) && Op2.match(I->getOperand(1)) &&

2008 Mask.match(I->getShuffleMask());

2009 }

2010 return false;

2011 }

2012};

2013

2022

2025 return all_of(Mask, [](int Elem) { return Elem == 0 || Elem == -1; });

2026 }

2027};

2028

2034

2039 const auto *First = find_if(Mask, [](int Elem) { return Elem != -1; });

2040 if (First == Mask.end())

2041 return false;

2044 [First](int Elem) { return Elem == *First || Elem == -1; });

2045 }

2046};

2047

2048template <typename PointerOpTy, typename OffsetOpTy> struct PtrAdd_match {

2051

2054

2055 template bool match(OpTy *V) const {

2057 return GEP && GEP->getSourceElementType()->isIntegerTy(8) &&

2058 PointerOp.match(GEP->getPointerOperand()) &&

2059 OffsetOp.match(GEP->idx_begin()->get());

2060 }

2061};

2062

2063

2064template <typename V1_t, typename V2_t>

2069

2070template <typename V1_t, typename V2_t, typename Mask_t>

2075

2076

2077template

2081

2082

2083template <typename ValueOpTy, typename PointerOpTy>

2085m_Store(const ValueOpTy &ValueOp, const PointerOpTy &PointerOp) {

2087 PointerOp);

2088}

2089

2090

2091template <typename... OperandTypes>

2092inline auto m_GEP(const OperandTypes &...Ops) {

2093 return AnyOps_match<Instruction::GetElementPtr, OperandTypes...>(Ops...);

2094}

2095

2096

2097template <typename PointerOpTy, typename OffsetOpTy>

2102

2103

2104

2105

2106

2109

2111

2112 template bool match(OpTy *V) const {

2114 return O->getOpcode() == Opcode && Op.match(O->getOperand(0));

2115 return false;

2116 }

2117};

2118

2121

2123

2124 template bool match(OpTy *V) const {

2126 return Op.match(I->getOperand(0));

2127 return false;

2128 }

2129};

2130

2134

2137

2138 template bool match(OpTy *V) const {

2140 return O->getOpcode() == Instruction::PtrToInt &&

2141 DL.getTypeSizeInBits(O->getType()) ==

2142 DL.getTypeSizeInBits(O->getOperand(0)->getType()) &&

2143 Op.match(O->getOperand(0));

2144 return false;

2145 }

2146};

2147

2150

2152

2153 template bool match(OpTy *V) const {

2155 return I->hasNonNeg() && Op.match(I->getOperand(0));

2156 return false;

2157 }

2158};

2159

2162

2164

2165 template bool match(OpTy *V) const {

2167 return (I->getNoWrapKind() & WrapFlags) == WrapFlags &&

2168 Op.match(I->getOperand(0));

2169 return false;

2170 }

2171};

2172

2173

2174template

2179

2182

2184

2185 template bool match(OpTy *V) const {

2187 if (I)

2188 return false;

2189 Type *SrcType = I->getSrcTy();

2190 Type *DstType = I->getType();

2191

2192

2193 if (SrcType->isVectorTy() != DstType->isVectorTy())

2194 return false;

2196 SrcVecTy && SrcVecTy->getElementCount() !=

2198 return false;

2199 return Op.match(I->getOperand(0));

2200 }

2201};

2202

2203template

2207

2208

2209template

2214

2215template

2217 const OpTy &Op) {

2219}

2220

2221

2222template

2227

2228

2232

2233

2234template

2239

2240

2241template

2246

2247

2248template

2252

2253

2254template

2259

2260

2261template

2266

2267template

2272

2273

2274template

2278

2279

2280template

2284

2285template

2289

2290template

2295

2296template

2301

2302

2303template

2308

2309template

2315

2316template

2319 OpTy>

2323

2324template

2327 OpTy>

2331

2332template

2336

2337template

2341

2342template

2346

2347template

2351

2352template

2356

2357template

2361

2362

2363

2364

2365

2368

2370

2371 template bool match(OpTy *V) const {

2373 if (BI->isUnconditional()) {

2374 Succ = BI->getSuccessor(0);

2375 return true;

2376 }

2377 return false;

2378 }

2379};

2380

2382

2383template <typename Cond_t, typename TrueBlock_t, typename FalseBlock_t>

2388

2389 brc_match(const Cond_t &C, const TrueBlock_t &t, const FalseBlock_t &f)

2390 : Cond(C), T(t), F(f) {}

2391

2392 template bool match(OpTy *V) const {

2394 if (BI->isConditional() && Cond.match(BI->getCondition()))

2395 return T.match(BI->getSuccessor(0)) && F.match(BI->getSuccessor(1));

2396 return false;

2397 }

2398};

2399

2400template <typename Cond_t>

2406

2407template <typename Cond_t, typename TrueBlock_t, typename FalseBlock_t>

2409m_Br(const Cond_t &C, const TrueBlock_t &T, const FalseBlock_t &F) {

2411}

2412

2413

2414

2415

2416

2417template <typename CmpInst_t, typename LHS_t, typename RHS_t, typename Pred_t,

2418 bool Commutable = false>

2423

2424

2425

2427

2428 template bool match(OpTy *V) const {

2431 if ((IID == Intrinsic::smax && Pred_t::match(ICmpInst::ICMP_SGT)) ||

2435 Value *LHS = II->getOperand(0), *RHS = II->getOperand(1);

2436 return (L.match(LHS) && R.match(RHS)) ||

2437 (Commutable && L.match(RHS) && R.match(LHS));

2438 }

2439 }

2440

2442 if (SI)

2443 return false;

2445 if (!Cmp)

2446 return false;

2447

2448

2449 auto *TrueVal = SI->getTrueValue();

2450 auto *FalseVal = SI->getFalseValue();

2451 auto *LHS = Cmp->getOperand(0);

2452 auto *RHS = Cmp->getOperand(1);

2453 if ((TrueVal != LHS || FalseVal != RHS) &&

2454 (TrueVal != RHS || FalseVal != LHS))

2455 return false;

2456 typename CmpInst_t::Predicate Pred =

2457 LHS == TrueVal ? Cmp->getPredicate() : Cmp->getInversePredicate();

2458

2459 if (!Pred_t::match(Pred))

2460 return false;

2461

2462 return (L.match(LHS) && R.match(RHS)) ||

2463 (Commutable && L.match(RHS) && R.match(LHS));

2464 }

2465};

2466

2467

2473

2474

2480

2481

2487

2488

2494

2495

2501

2502

2508

2509

2515

2516

2522

2523template <typename LHS, typename RHS>

2525 const RHS &R) {

2527}

2528

2529template <typename LHS, typename RHS>

2531 const RHS &R) {

2533}

2534

2535template <typename LHS, typename RHS>

2537 const RHS &R) {

2539}

2540

2541template <typename LHS, typename RHS>

2543 const RHS &R) {

2545}

2546

2547template <typename LHS, typename RHS>

2557

2558

2559

2560

2561

2562

2563

2564

2565

2566

2567template <typename LHS, typename RHS>

2569 const RHS &R) {

2571}

2572

2573

2574

2575

2576

2577

2578

2579

2580

2581

2582template <typename LHS, typename RHS>

2584 const RHS &R) {

2586}

2587

2588

2589

2590

2591

2592

2593

2594

2595

2596

2597template <typename LHS, typename RHS>

2602

2603

2604

2605

2606

2607

2608

2609

2610

2611

2612template <typename LHS, typename RHS>

2617

2618

2619

2620

2621

2622

2623template <typename LHS, typename RHS>

2630

2631

2632

2633

2634

2635

2636template <typename LHS, typename RHS>

2643

2644

2645

2646

2647template

2652

2653template

2655 true>

2659

2660

2661

2662

2663

2664

2665template <typename LHS_t, typename RHS_t, typename Sum_t>

2670

2673

2674 template bool match(OpTy *V) const {

2675 Value *ICmpLHS, *ICmpRHS;

2678 return false;

2679

2680 Value *AddLHS, *AddRHS;

2682

2683

2685 if (AddExpr.match(ICmpLHS) && (ICmpRHS == AddLHS || ICmpRHS == AddRHS))

2686 return L.match(AddLHS) && R.match(AddRHS) && S.match(ICmpLHS);

2687

2688

2690 if (AddExpr.match(ICmpRHS) && (ICmpLHS == AddLHS || ICmpLHS == AddRHS))

2691 return L.match(AddLHS) && R.match(AddRHS) && S.match(ICmpRHS);

2692

2695

2697 if (XorExpr.match(ICmpLHS))

2698 return L.match(Op1) && R.match(ICmpRHS) && S.match(ICmpLHS);

2699 }

2700

2702 if (XorExpr.match(ICmpRHS))

2703 return L.match(Op1) && R.match(ICmpLHS) && S.match(ICmpRHS);

2704 }

2705

2706

2708

2709

2710 if (AddExpr.match(ICmpLHS) && m_ZeroInt().match(ICmpRHS) &&

2712 return L.match(AddLHS) && R.match(AddRHS) && S.match(ICmpLHS);

2713

2714

2715 if (m_ZeroInt().match(ICmpLHS) && AddExpr.match(ICmpRHS) &&

2717 return L.match(AddLHS) && R.match(AddRHS) && S.match(ICmpRHS);

2718 }

2719

2720 return false;

2721 }

2722};

2723

2724

2725

2726

2727

2728template <typename LHS_t, typename RHS_t, typename Sum_t>

2733

2737

2739

2740 template bool match(OpTy *V) const {

2741

2743 return Val.match(CI->getArgOperand(OpI));

2744 return false;

2745 }

2746};

2747

2748

2749template <unsigned OpI, typename Opnd_t>

2753

2754

2757

2759

2760 template bool match(OpTy *V) const {

2763 return F->getIntrinsicID() == ID;

2764 return false;

2765 }

2766};

2767

2768

2769

2770

2771

2772template <typename T0 = void, typename T1 = void, typename T2 = void,

2773 typename T3 = void, typename T4 = void, typename T5 = void,

2774 typename T6 = void, typename T7 = void, typename T8 = void,

2775 typename T9 = void, typename T10 = void>

2784template <typename T0, typename T1, typename T2>

2789template <typename T0, typename T1, typename T2, typename T3>

2794

2795template <typename T0, typename T1, typename T2, typename T3, typename T4>

2800

2801template <typename T0, typename T1, typename T2, typename T3, typename T4,

2802 typename T5>

2807

2808

2809

2813

2814

2815template <typename Opnd0, typename Opnd1, typename Opnd2>

2820

2821

2822template <typename Opnd0, typename Opnd1, typename Opnd2>

2827

2828

2829template <typename Opnd0, typename Opnd1, typename Opnd2>

2834

2835template <Intrinsic::ID IntrID, typename T0>

2839

2840template <Intrinsic::ID IntrID, typename T0, typename T1>

2842 const T1 &Op1) {

2844}

2845

2846template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2>

2851

2852template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2,

2853 typename T3>

2858

2859template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2,

2860 typename T3, typename T4>

2862m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3,

2863 const T4 &Op4) {

2866}

2867

2868template <Intrinsic::ID IntrID, typename T0, typename T1, typename T2,

2869 typename T3, typename T4, typename T5>

2871m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3,

2872 const T4 &Op4, const T5 &Op5) {

2875}

2876

2877

2878template

2882

2883template

2887

2888template

2892

2893template

2897

2898template <typename Opnd0, typename Opnd1>

2900 const Opnd1 &Op1) {

2902}

2903

2904template <typename Opnd0, typename Opnd1>

2906 const Opnd1 &Op1) {

2908}

2909

2910template <typename Opnd0, typename Opnd1>

2915

2916template <typename Opnd0, typename Opnd1>

2918 const Opnd1 &Op1) {

2920}

2921

2922template <typename Opnd0, typename Opnd1>

2924 const Opnd1 &Op1) {

2926}

2927

2928template <typename Opnd0, typename Opnd1>

2933

2934template <typename Opnd0, typename Opnd1, typename Opnd2>

2936m_FShl(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2) {

2938}

2939

2940template <typename Opnd0, typename Opnd1, typename Opnd2>

2942m_FShr(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2) {

2944}

2945

2946template

2950

2951template <typename Opnd0, typename Opnd1>

2953 const Opnd1 &Op1) {

2955}

2956

2957template

2961

2962template <typename Opnd0, typename Opnd1, typename Opnd2>

2967

2968

2969

2970

2971

2972

2973template <typename LHS, typename RHS>

2977

2978

2979

2980template <typename LHS, typename RHS>

2985

2986template <typename LHS, typename RHS>

2988 const RHS &R) {

2990}

2991

2992

2993template <typename LHS, typename RHS>

2998

2999

3000template <typename LHS, typename RHS>

3002 const RHS &R) {

3004}

3005

3006

3007template <typename LHS, typename RHS>

3009 const RHS &R) {

3011}

3012

3013

3014template <typename LHS, typename RHS>

3016 const RHS &R) {

3018}

3019

3020

3021template <typename LHS, typename RHS>

3023 const RHS &R) {

3025}

3026

3027

3028template <typename LHS, typename RHS>

3030 const RHS &R) {

3032}

3033

3034

3035template

3040

3041

3042template

3044 Instruction::Sub,

3049

3050

3051template <typename LHS, typename RHS>

3056

3057template <typename LHS, typename RHS>

3062

3063template <typename LHS, typename RHS>

3068

3069template <typename LHS, typename RHS>

3074

3075template <typename LHS, typename RHS>

3085

3086template <Intrinsic::ID IntrID, typename LHS, typename RHS>

3090

3092

3093 template bool match(OpTy *V) const {

3095 if (II || II->getIntrinsicID() != IntrID)

3096 return false;

3097 return (L.match(II->getArgOperand(0)) && R.match(II->getArgOperand(1))) ||

3098 (L.match(II->getArgOperand(1)) && R.match(II->getArgOperand(0)));

3099 }

3100};

3101

3102template <Intrinsic::ID IntrID, typename T0, typename T1>

3107

3108

3109template <typename LHS, typename RHS>

3114

3115

3116template <typename LHS, typename RHS>

3121

3125

3126 template bool match(OpTy *V) const {

3127 unsigned TypeSize = V->getType()->getScalarSizeInBits();

3129 return false;

3130

3131 unsigned ShiftWidth = TypeSize - 1;

3133

3134

3135

3136

3137

3138

3139

3140

3141

3142

3143

3147

3148 return Signum.match(V) && Val.match(Op);

3149 }

3150};

3151

3152

3153

3154

3155

3156

3157

3161

3165

3166 template bool match(OpTy *V) const {

3168

3169 if (Ind != -1 &&

3170 !(I->getNumIndices() == 1 && I->getIndices()[0] == (unsigned)Ind))

3171 return false;

3172 return Val.match(I->getAggregateOperand());

3173 }

3174 return false;

3175 }

3176};

3177

3178

3179

3180template <int Ind, typename Val_t>

3184

3185

3186

3187template <typename Val_t>

3191

3192

3196

3198

3199 template bool match(OpTy *V) const {

3201 return Op0.match(I->getOperand(0)) && Op1.match(I->getOperand(1)) &&

3202 I->getNumIndices() == 1 && Ind == I->getIndices()[0];

3203 }

3204 return false;

3205 }

3206};

3207

3208

3209template <int Ind, typename Val_t, typename Elt_t>

3211 const Elt_t &Elt) {

3213}

3214

3215

3217

3218template <typename Opnd0, typename Opnd1>

3223

3224template

3228

3229template <typename LHS, typename RHS, unsigned Opcode, bool Commutable = false>

3233

3235

3236 template bool match(T *V) const {

3238 if (I || I->getType()->isIntOrIntVectorTy(1))

3239 return false;

3240

3241 if (I->getOpcode() == Opcode) {

3242 auto *Op0 = I->getOperand(0);

3243 auto *Op1 = I->getOperand(1);

3244 return (L.match(Op0) && R.match(Op1)) ||

3245 (Commutable && L.match(Op1) && R.match(Op0));

3246 }

3247

3249 auto *Cond = Select->getCondition();

3250 auto *TVal = Select->getTrueValue();

3251 auto *FVal = Select->getFalseValue();

3252

3253

3254

3255 if (Cond->getType() != Select->getType())

3256 return false;

3257

3258 if (Opcode == Instruction::And) {

3260 if (C && C->isNullValue())

3261 return (L.match(Cond) && R.match(TVal)) ||

3262 (Commutable && L.match(TVal) && R.match(Cond));

3263 } else {

3264 assert(Opcode == Instruction::Or);

3266 if (C && C->isOneValue())

3267 return (L.match(Cond) && R.match(FVal)) ||

3268 (Commutable && L.match(FVal) && R.match(Cond));

3269 }

3270 }

3271

3272 return false;

3273 }

3274};

3275

3276

3277

3278template <typename LHS, typename RHS>

3280 const RHS &R) {

3282}

3283

3284

3286

3287

3288template <typename LHS, typename RHS>

3293

3294

3295

3296template <typename LHS, typename RHS>

3298 const RHS &R) {

3300}

3301

3302

3304

3305

3306template <typename LHS, typename RHS>

3311

3312

3313

3314

3315template <typename LHS, typename RHS, bool Commutable = false>

3321

3322

3324

3325

3326template <typename LHS, typename RHS>

3330

3331}

3332}

3333

3334#endif

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.

uint64_t getZExtValue() const

Get zero extended value.

unsigned getActiveBits() const

Compute the number of active bits in the value.

static bool isSameValue(const APInt &I1, const APInt &I2)

Determine if two APInts have the same value, after zero-extending one of them (if needed!...

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.

A parsed version of the target data layout string in and methods for querying it.

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.

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.

'undef' values are things that do not have specified contents.

LLVM Value Representation.

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.

Definition PatternMatch.h:47

TwoOps_match< ValueOpTy, PointerOpTy, Instruction::Store > m_Store(const ValueOpTy &ValueOp, const PointerOpTy &PointerOp)

Matches StoreInst.

Definition PatternMatch.h:2085

cst_pred_ty< is_all_ones > m_AllOnes()

Match an integer or vector with all bits set.

Definition PatternMatch.h:536

class_match< PoisonValue > m_Poison()

Match an arbitrary poison constant.

Definition PatternMatch.h:173

cst_pred_ty< is_lowbit_mask > m_LowBitMask()

Match an integer or vector with only the low bit(s) set.

Definition PatternMatch.h:685

BinaryOp_match< LHS, RHS, Instruction::And > m_And(const LHS &L, const RHS &R)

Definition PatternMatch.h:1322

PtrAdd_match< PointerOpTy, OffsetOpTy > m_PtrAdd(const PointerOpTy &PointerOp, const OffsetOpTy &OffsetOp)

Matches GEP with i8 source element type.

Definition PatternMatch.h:2099

cst_pred_ty< is_negative > m_Negative()

Match an integer or vector of negative values.

Definition PatternMatch.h:562

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).

Definition PatternMatch.h:1384

BinaryOp_match< cst_pred_ty< is_all_ones, false >, ValTy, Instruction::Xor, true > m_NotForbidPoison(const ValTy &V)

Definition PatternMatch.h:2656

MaxMin_match< FCmpInst, LHS, RHS, ufmin_pred_ty > m_UnordFMin(const LHS &L, const RHS &R)

Match an 'unordered' floating point minimum function.

Definition PatternMatch.h:2614

PtrToIntSameSize_match< OpTy > m_PtrToIntSameSize(const DataLayout &DL, const OpTy &Op)

Definition PatternMatch.h:2216

BinaryOp_match< LHS, RHS, Instruction::Add > m_Add(const LHS &L, const RHS &R)

Definition PatternMatch.h:1208

class_match< BinaryOperator > m_BinOp()

Match an arbitrary binary operation and ignore it.

Definition PatternMatch.h:113

m_Intrinsic_Ty< Opnd0 >::Ty m_FCanonicalize(const Opnd0 &Op0)

Definition PatternMatch.h:2894

CmpClass_match< LHS, RHS, FCmpInst > m_FCmp(CmpPredicate &Pred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1786

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.

Definition PatternMatch.h:3118

cst_pred_ty< is_sign_mask > m_SignMask()

Match an integer or vector with only the sign bit(s) set.

Definition PatternMatch.h:676

OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWAdd(const LHS &L, const RHS &R)

Definition PatternMatch.h:1467

BinaryOp_match< LHS, RHS, Instruction::AShr > m_AShr(const LHS &L, const RHS &R)

Definition PatternMatch.h:1352

auto m_PtrToIntOrAddr(const OpTy &Op)

Matches PtrToInt or PtrToAddr.

Definition PatternMatch.h:2229

cstfp_pred_ty< is_inf > m_Inf()

Match a positive or negative infinity FP constant.

Definition PatternMatch.h:740

m_Intrinsic_Ty< Opnd0 >::Ty m_BitReverse(const Opnd0 &Op0)

Definition PatternMatch.h:2879

BinaryOp_match< LHS, RHS, Instruction::FSub > m_FSub(const LHS &L, const RHS &R)

Definition PatternMatch.h:1226

cst_pred_ty< is_power2 > m_Power2()

Match an integer or vector power-of-2.

Definition PatternMatch.h:631

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedStore(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Matches MaskedStore Intrinsic.

Definition PatternMatch.h:2824

OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap, true > m_c_NSWAdd(const LHS &L, const RHS &R)

Definition PatternMatch.h:1434

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'.

Definition PatternMatch.h:1269

BinaryOp_match< LHS, RHS, Instruction::URem > m_URem(const LHS &L, const RHS &R)

Definition PatternMatch.h:1304

match_combine_or< CastInst_match< OpTy, CastInst >, OpTy > m_CastOrSelf(const OpTy &Op)

Matches any cast or self. Used to ignore casts.

Definition PatternMatch.h:2243

match_combine_or< CastInst_match< OpTy, TruncInst >, OpTy > m_TruncOrSelf(const OpTy &Op)

Definition PatternMatch.h:2269

auto m_LogicalOp()

Matches either L && R or L || R where L and R are arbitrary values.

Definition PatternMatch.h:3323

CommutativeBinaryIntrinsic_match< IntrID, T0, T1 > m_c_Intrinsic(const T0 &Op0, const T1 &Op1)

Definition PatternMatch.h:3104

class_match< Constant > m_Constant()

Match an arbitrary Constant and ignore it.

Definition PatternMatch.h:178

AllowReassoc_match< T > m_AllowReassoc(const T &SubPattern)

Definition PatternMatch.h:96

OneOps_match< OpTy, Instruction::Freeze > m_Freeze(const OpTy &Op)

Matches FreezeInst.

Definition PatternMatch.h:1977

ap_match< APInt > m_APInt(const APInt *&Res)

Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.

Definition PatternMatch.h:311

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.

Definition PatternMatch.h:3015

ap_match< APFloat > m_APFloatForbidPoison(const APFloat *&Res)

Match APFloat while forbidding poison in splat vector constants.

Definition PatternMatch.h:339

cst_pred_ty< is_power2_or_zero > m_Power2OrZero()

Match an integer or vector of 0 or power-of-2 values.

Definition PatternMatch.h:664

CastInst_match< OpTy, TruncInst > m_Trunc(const OpTy &Op)

Matches Trunc.

Definition PatternMatch.h:2249

BinaryOp_match< LHS, RHS, Instruction::Xor > m_Xor(const LHS &L, const RHS &R)

Definition PatternMatch.h:1334

br_match m_UnconditionalBr(BasicBlock *&Succ)

Definition PatternMatch.h:2381

CastOperator_match< OpTy, Instruction::PtrToAddr > m_PtrToAddr(const OpTy &Op)

Matches PtrToAddr.

Definition PatternMatch.h:2224

ap_match< APInt > m_APIntAllowPoison(const APInt *&Res)

Match APInt while allowing poison in splat vector constants.

Definition PatternMatch.h:317

OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoSignedWrap > m_NSWSub(const LHS &L, const RHS &R)

Definition PatternMatch.h:1442

specific_intval< false > m_SpecificInt(const APInt &V)

Match a specific integer value or vector with all elements equal to the value.

Definition PatternMatch.h:1086

BinaryOp_match< LHS, RHS, Instruction::FMul > m_FMul(const LHS &L, const RHS &R)

Definition PatternMatch.h:1280

match_combine_or< CastInst_match< OpTy, ZExtInst >, OpTy > m_ZExtOrSelf(const OpTy &Op)

Definition PatternMatch.h:2292

bool match(Val *V, const Pattern &P)

Definition PatternMatch.h:49

BinOpPred_match< LHS, RHS, is_idiv_op > m_IDiv(const LHS &L, const RHS &R)

Matches integer division operations.

Definition PatternMatch.h:1706

cst_pred_ty< is_shifted_mask > m_ShiftedMask()

Definition PatternMatch.h:527

bind_ty< Instruction > m_Instruction(Instruction *&I)

Match an instruction, capturing it if we match.

Definition PatternMatch.h:874

cstval_pred_ty< Predicate, ConstantInt, AllowPoison > cst_pred_ty

specialization of cstval_pred_ty for ConstantInt

Definition PatternMatch.h:416

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaxNum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2917

cstfp_pred_ty< is_any_zero_fp > m_AnyZeroFP()

Match a floating-point negative zero or positive zero.

Definition PatternMatch.h:778

specificval_ty m_Specific(const Value *V)

Match if we have a specific specified value.

Definition PatternMatch.h:988

DisjointOr_match< LHS, RHS > m_DisjointOr(const LHS &L, const RHS &R)

Definition PatternMatch.h:1548

constantexpr_match m_ConstantExpr()

Match a constant expression or a constant that contains a constant expression.

Definition PatternMatch.h:199

BinOpPred_match< LHS, RHS, is_right_shift_op > m_Shr(const LHS &L, const RHS &R)

Matches logical shift operations.

Definition PatternMatch.h:1678

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 ...

Definition PatternMatch.h:1610

specific_intval< true > m_SpecificIntAllowPoison(const APInt &V)

Definition PatternMatch.h:1094

ap_match< APFloat > m_APFloat(const APFloat *&Res)

Match a ConstantFP or splatted ConstantVector, binding the specified pointer to the contained APFloat...

Definition PatternMatch.h:328

ap_match< APFloat > m_APFloatAllowPoison(const APFloat *&Res)

Match APFloat while allowing poison in splat vector constants.

Definition PatternMatch.h:334

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.

Definition PatternMatch.h:2982

OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoUnsignedWrap, true > m_c_NUWAdd(const LHS &L, const RHS &R)

Definition PatternMatch.h:1476

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'.

Definition PatternMatch.h:3046

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedLoad(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Matches MaskedLoad Intrinsic.

Definition PatternMatch.h:2817

TwoOps_match< Val_t, Idx_t, Instruction::ExtractElement > m_ExtractElt(const Val_t &Val, const Idx_t &Idx)

Matches ExtractElementInst.

Definition PatternMatch.h:1992

cstfp_pred_ty< is_finite > m_Finite()

Match a finite FP constant, i.e.

Definition PatternMatch.h:756

cst_pred_ty< is_nonnegative > m_NonNegative()

Match an integer or vector of non-negative values.

Definition PatternMatch.h:572

class_match< ConstantInt > m_ConstantInt()

Match an arbitrary ConstantInt and ignore it.

Definition PatternMatch.h:181

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.

Definition PatternMatch.h:3316

cst_pred_ty< is_one > m_One()

Match an integer 1 or a vector with all elements equal to 1.

Definition PatternMatch.h:604

IntrinsicID_match m_Intrinsic()

Match intrinsic calls like this: m_IntrinsicIntrinsic::fabs(m_Value(X))

Definition PatternMatch.h:2810

ThreeOps_match< Cond, LHS, RHS, Instruction::Select > m_Select(const Cond &C, const LHS &L, const RHS &R)

Matches SelectInst.

Definition PatternMatch.h:1954

IntrinsicID_match m_VScale()

Matches a call to llvm.vscale().

Definition PatternMatch.h:3216

cstfp_pred_ty< is_neg_zero_fp > m_NegZeroFP()

Match a floating-point negative zero.

Definition PatternMatch.h:796

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinimum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2905

match_combine_or< CastInst_match< OpTy, SExtInst >, OpTy > m_SExtOrSelf(const OpTy &Op)

Definition PatternMatch.h:2298

InsertValue_match< Ind, Val_t, Elt_t > m_InsertValue(const Val_t &Val, const Elt_t &Elt)

Matches a single index InsertValue instruction.

Definition PatternMatch.h:3210

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.

Definition PatternMatch.h:2639

specific_fpval m_SpecificFP(double V)

Match a specific floating point value or vector with all elements equal to the value.

Definition PatternMatch.h:1031

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_Interleave2(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:3220

ExtractValue_match< Ind, Val_t > m_ExtractValue(const Val_t &V)

Match a single index ExtractValue instruction.

Definition PatternMatch.h:3181

BinOpPred_match< LHS, RHS, is_logical_shift_op > m_LogicalShift(const LHS &L, const RHS &R)

Matches logical shift operations.

Definition PatternMatch.h:1686

match_combine_and< LTy, RTy > m_CombineAnd(const LTy &L, const RTy &R)

Combine two pattern matchers matching L && R.

Definition PatternMatch.h:278

MaxMin_match< ICmpInst, LHS, RHS, smin_pred_ty > m_SMin(const LHS &L, const RHS &R)

Definition PatternMatch.h:2530

cst_pred_ty< is_any_apint > m_AnyIntegralConstant()

Match an integer or vector with any integral constant.

Definition PatternMatch.h:519

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaximum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2923

CastInst_match< OpTy, FPToUIInst > m_FPToUI(const OpTy &Op)

Definition PatternMatch.h:2343

m_Intrinsic_Ty< Opnd0 >::Ty m_Sqrt(const Opnd0 &Op0)

Definition PatternMatch.h:2947

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).

Definition PatternMatch.h:1377

bind_ty< WithOverflowInst > m_WithOverflowInst(WithOverflowInst *&I)

Match a with overflow intrinsic, capturing it if we match.

Definition PatternMatch.h:902

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.

Definition PatternMatch.h:3029

BinaryOp_match< LHS, RHS, Instruction::FAdd > m_FAdd(const LHS &L, const RHS &R)

Definition PatternMatch.h:1214

SpecificCmpClass_match< LHS, RHS, CmpInst > m_SpecificCmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1837

BinaryOp_match< LHS, RHS, Instruction::Mul > m_Mul(const LHS &L, const RHS &R)

Definition PatternMatch.h:1274

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()...

Definition PatternMatch.h:1006

cst_pred_ty< is_zero_int > m_ZeroInt()

Match an integer 0 or a vector with all elements equal to 0.

Definition PatternMatch.h:611

NoWrapTrunc_match< OpTy, TruncInst::NoSignedWrap > m_NSWTrunc(const OpTy &Op)

Matches trunc nsw.

Definition PatternMatch.h:2263

match_combine_or< match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, SExtInst > >, OpTy > m_ZExtOrSExtOrSelf(const OpTy &Op)

Definition PatternMatch.h:2320

OneUse_match< T > m_OneUse(const T &SubPattern)

Definition PatternMatch.h:80

NNegZExt_match< OpTy > m_NNegZExt(const OpTy &Op)

Definition PatternMatch.h:2286

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.

Definition PatternMatch.h:3053

auto m_LogicalOr()

Matches L || R where L and R are arbitrary values.

Definition PatternMatch.h:3303

BinaryOp_match< cst_pred_ty< is_zero_int >, ValTy, Instruction::Sub > m_Neg(const ValTy &V)

Matches a 'Neg' as 'sub 0, V'.

Definition PatternMatch.h:3037

Splat_match< T > m_ConstantSplat(const T &SubPattern)

Match a constant splat. TODO: Extend this to non-constant splats.

Definition PatternMatch.h:217

TwoOps_match< V1_t, V2_t, Instruction::ShuffleVector > m_Shuffle(const V1_t &v1, const V2_t &v2)

Matches ShuffleVectorInst independently of mask value.

Definition PatternMatch.h:2066

specific_bbval m_SpecificBB(BasicBlock *BB)

Match a specific basic block value.

Definition PatternMatch.h:1119

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.

Definition PatternMatch.h:3071

auto m_GEP(const OperandTypes &...Ops)

Matches GetElementPtrInst.

Definition PatternMatch.h:2092

ap_match< APInt > m_APIntForbidPoison(const APInt *&Res)

Match APInt while forbidding poison in splat vector constants.

Definition PatternMatch.h:322

cst_pred_ty< is_strictlypositive > m_StrictlyPositive()

Match an integer or vector of strictly positive values.

Definition PatternMatch.h:582

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)

Definition PatternMatch.h:1970

CastInst_match< OpTy, FPExtInst > m_FPExt(const OpTy &Op)

Definition PatternMatch.h:2358

OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoSignedWrap > m_NSWShl(const LHS &L, const RHS &R)

Definition PatternMatch.h:1458

class_match< ConstantFP > m_ConstantFP()

Match an arbitrary ConstantFP and ignore it.

Definition PatternMatch.h:186

cstfp_pred_ty< is_nonnan > m_NonNaN()

Match a non-NaN FP constant.

Definition PatternMatch.h:731

SpecificCmpClass_match< LHS, RHS, ICmpInst > m_SpecificICmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1843

OneOps_match< OpTy, Instruction::Load > m_Load(const OpTy &Op)

Matches LoadInst.

Definition PatternMatch.h:2078

CastInst_match< OpTy, ZExtInst > m_ZExt(const OpTy &Op)

Matches ZExt.

Definition PatternMatch.h:2281

OverflowingBinaryOp_match< LHS, RHS, Instruction::Shl, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWShl(const LHS &L, const RHS &R)

Definition PatternMatch.h:1501

cstfp_pred_ty< is_non_zero_not_denormal_fp > m_NonZeroNotDenormalFP()

Match a floating-point non-zero that is not a denormal.

Definition PatternMatch.h:817

cst_pred_ty< is_all_ones, false > m_AllOnesForbidPoison()

Definition PatternMatch.h:540

OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWMul(const LHS &L, const RHS &R)

Definition PatternMatch.h:1493

BinaryOp_match< LHS, RHS, Instruction::UDiv > m_UDiv(const LHS &L, const RHS &R)

Definition PatternMatch.h:1286

BinOpPred_match< LHS, RHS, is_bitwiselogic_op, true > m_c_BitwiseLogic(const LHS &L, const RHS &R)

Matches bitwise logic operations in either order.

Definition PatternMatch.h:1700

class_match< UndefValue > m_UndefValue()

Match an arbitrary UndefValue constant.

Definition PatternMatch.h:168

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMaximumNum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2930

MaxMin_match< ICmpInst, LHS, RHS, umax_pred_ty > m_UMax(const LHS &L, const RHS &R)

Definition PatternMatch.h:2536

class_match< CmpInst > m_Cmp()

Matches any compare instruction and ignore it.

Definition PatternMatch.h:118

brc_match< Cond_t, bind_ty< BasicBlock >, bind_ty< BasicBlock > > m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F)

Definition PatternMatch.h:2402

cst_pred_ty< is_negated_power2 > m_NegatedPower2()

Match a integer or vector negated power-of-2.

Definition PatternMatch.h:639

match_immconstant_ty m_ImmConstant()

Match an arbitrary immediate Constant and ignore it.

Definition PatternMatch.h:957

cst_pred_ty< is_negated_power2_or_zero > m_NegatedPower2OrZero()

Match a integer or vector negated power-of-2.

Definition PatternMatch.h:651

auto m_c_LogicalOp(const LHS &L, const RHS &R)

Matches either L && R or L || R with LHS and RHS in either order.

Definition PatternMatch.h:3327

NoWrapTrunc_match< OpTy, TruncInst::NoUnsignedWrap > m_NUWTrunc(const OpTy &Op)

Matches trunc nuw.

Definition PatternMatch.h:2256

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).

Definition PatternMatch.h:1391

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.

Definition PatternMatch.h:493

cst_pred_ty< is_lowbit_mask_or_zero > m_LowBitMaskOrZero()

Match an integer or vector with only the low bit(s) set.

Definition PatternMatch.h:695

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinimumNum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2912

specific_fpval m_FPOne()

Match a float 1.0 or vector with all elements equal to 1.0.

Definition PatternMatch.h:1034

DisjointOr_match< LHS, RHS, true > m_c_DisjointOr(const LHS &L, const RHS &R)

Definition PatternMatch.h:1553

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.

Definition PatternMatch.h:3065

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.

Definition PatternMatch.h:3001

SpecificCmpClass_match< LHS, RHS, FCmpInst > m_SpecificFCmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1855

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".

Definition PatternMatch.h:1562

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_MaskedGather(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Matches MaskedGather Intrinsic.

Definition PatternMatch.h:2831

CastInst_match< OpTy, UIToFPInst > m_UIToFP(const OpTy &Op)

Definition PatternMatch.h:2333

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.

Definition PatternMatch.h:2626

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.

Definition PatternMatch.h:3059

CastOperator_match< OpTy, Instruction::BitCast > m_BitCast(const OpTy &Op)

Matches BitCast.

Definition PatternMatch.h:2176

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_FShl(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Definition PatternMatch.h:2936

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)

Definition PatternMatch.h:3081

MaxMin_match< FCmpInst, LHS, RHS, ufmax_pred_ty > m_UnordFMax(const LHS &L, const RHS &R)

Match an 'unordered' floating point maximum function.

Definition PatternMatch.h:2599

cstval_pred_ty< Predicate, ConstantFP, true > cstfp_pred_ty

specialization of cstval_pred_ty for ConstantFP

Definition PatternMatch.h:420

match_combine_or< CastInst_match< OpTy, SExtInst >, NNegZExt_match< OpTy > > m_SExtLike(const OpTy &Op)

Match either "sext" or "zext nneg".

Definition PatternMatch.h:2305

cstfp_pred_ty< is_finitenonzero > m_FiniteNonZero()

Match a finite non-zero FP constant.

Definition PatternMatch.h:766

class_match< UnaryOperator > m_UnOp()

Match an arbitrary unary operation and ignore it.

Definition PatternMatch.h:108

CastInst_match< OpTy, FPToSIInst > m_FPToSI(const OpTy &Op)

Definition PatternMatch.h:2348

BinaryOp_match< LHS, RHS, Instruction::SDiv > m_SDiv(const LHS &L, const RHS &R)

Definition PatternMatch.h:1292

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.

Definition PatternMatch.h:505

OverflowingBinaryOp_match< LHS, RHS, Instruction::Sub, OverflowingBinaryOperator::NoUnsignedWrap > m_NUWSub(const LHS &L, const RHS &R)

Definition PatternMatch.h:1485

MaxMin_match< ICmpInst, LHS, RHS, smax_pred_ty > m_SMax(const LHS &L, const RHS &R)

Definition PatternMatch.h:2524

cst_pred_ty< is_maxsignedvalue > m_MaxSignedValue()

Match an integer or vector with values having all bits except for the high bit set (0x7f....

Definition PatternMatch.h:550

MaxMin_match< FCmpInst, LHS, RHS, ofmax_pred_ty > m_OrdFMax(const LHS &L, const RHS &R)

Match an 'ordered' floating point maximum function.

Definition PatternMatch.h:2568

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".

Definition PatternMatch.h:1572

class_match< Value > m_Value()

Match an arbitrary value and ignore it.

Definition PatternMatch.h:105

AnyBinaryOp_match< LHS, RHS, true > m_c_BinOp(const LHS &L, const RHS &R)

Matches a BinaryOperator with LHS and RHS in either order.

Definition PatternMatch.h:2974

Signum_match< Val_t > m_Signum(const Val_t &V)

Matches a signum pattern.

Definition PatternMatch.h:3158

OverflowingBinaryOp_match< LHS, RHS, Instruction::Add, OverflowingBinaryOperator::NoSignedWrap > m_NSWAdd(const LHS &L, const RHS &R)

Definition PatternMatch.h:1426

CastInst_match< OpTy, SIToFPInst > m_SIToFP(const OpTy &Op)

Definition PatternMatch.h:2338

BinaryOp_match< LHS, RHS, Instruction::LShr > m_LShr(const LHS &L, const RHS &R)

Definition PatternMatch.h:1346

CmpClass_match< LHS, RHS, ICmpInst > m_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1780

Argument_match< Opnd_t > m_Argument(const Opnd_t &Op)

Match an argument.

Definition PatternMatch.h:2750

match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, SExtInst > > m_ZExtOrSExt(const OpTy &Op)

Definition PatternMatch.h:2312

Exact_match< T > m_Exact(const T &SubPattern)

Definition PatternMatch.h:1733

FNeg_match< OpTy > m_FNeg(const OpTy &X)

Match 'fneg X' as 'fsub -0.0, X'.

Definition PatternMatch.h:1262

BinOpPred_match< LHS, RHS, is_shift_op > m_Shift(const LHS &L, const RHS &R)

Matches shift operations.

Definition PatternMatch.h:1671

cstfp_pred_ty< is_pos_zero_fp > m_PosZeroFP()

Match a floating-point positive zero.

Definition PatternMatch.h:787

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.

Definition PatternMatch.h:3111

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.

Definition PatternMatch.h:3290

BinaryOp_match< LHS, RHS, Instruction::Shl > m_Shl(const LHS &L, const RHS &R)

Definition PatternMatch.h:1340

cstfp_pred_ty< is_non_zero_fp > m_NonZeroFP()

Match a floating-point non-zero.

Definition PatternMatch.h:805

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.

Definition PatternMatch.h:2730

BinaryOp_match< LHS, RHS, Instruction::FDiv > m_FDiv(const LHS &L, const RHS &R)

Definition PatternMatch.h:1298

m_Intrinsic_Ty< Opnd0 >::Ty m_VecReverse(const Opnd0 &Op0)

Definition PatternMatch.h:2958

BinOpPred_match< LHS, RHS, is_irem_op > m_IRem(const LHS &L, const RHS &R)

Matches integer remainder operations.

Definition PatternMatch.h:1713

auto m_LogicalAnd()

Matches L && R where L and R are arbitrary values.

Definition PatternMatch.h:3285

MaxMin_match< FCmpInst, LHS, RHS, ofmin_pred_ty > m_OrdFMin(const LHS &L, const RHS &R)

Match an 'ordered' floating point minimum function.

Definition PatternMatch.h:2583

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)

Definition PatternMatch.h:2553

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_FShr(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Definition PatternMatch.h:2942

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))

Definition PatternMatch.h:1963

BinaryOp_match< LHS, RHS, Instruction::FRem > m_FRem(const LHS &L, const RHS &R)

Definition PatternMatch.h:1316

CastInst_match< OpTy, FPTruncInst > m_FPTrunc(const OpTy &Op)

Definition PatternMatch.h:2353

class_match< BasicBlock > m_BasicBlock()

Match an arbitrary basic block value and ignore it.

Definition PatternMatch.h:222

BinaryOp_match< LHS, RHS, Instruction::SRem > m_SRem(const LHS &L, const RHS &R)

Definition PatternMatch.h:1310

auto m_Undef()

Match an arbitrary undef constant.

Definition PatternMatch.h:165

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_FMinNum(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2899

cst_pred_ty< is_nonpositive > m_NonPositive()

Match an integer or vector of non-positive values.

Definition PatternMatch.h:594

cstfp_pred_ty< is_nan > m_NaN()

Match an arbitrary NaN constant.

Definition PatternMatch.h:724

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'.

Definition PatternMatch.h:2649

BinaryOp_match< LHS, RHS, Instruction::Or > m_Or(const LHS &L, const RHS &R)

Definition PatternMatch.h:1328

m_Intrinsic_Ty< Opnd0 >::Ty m_BSwap(const Opnd0 &Op0)

Definition PatternMatch.h:2884

CastInst_match< OpTy, SExtInst > m_SExt(const OpTy &Op)

Matches SExt.

Definition PatternMatch.h:2275

is_zero m_Zero()

Match any null constant or a vector with all elements equal to 0.

Definition PatternMatch.h:624

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.

Definition PatternMatch.h:3022

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".

Definition PatternMatch.h:1582

CastOperator_match< OpTy, Instruction::IntToPtr > m_IntToPtr(const OpTy &Op)

Matches IntToPtr.

Definition PatternMatch.h:2236

BinOpPred_match< LHS, RHS, is_bitwiselogic_op > m_BitwiseLogic(const LHS &L, const RHS &R)

Matches bitwise logic operations.

Definition PatternMatch.h:1693

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.

Definition PatternMatch.h:3308

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.

Definition PatternMatch.h:1984

SpecificCmpClass_match< LHS, RHS, ICmpInst, true > m_c_SpecificICmp(CmpPredicate MatchPred, const LHS &L, const RHS &R)

Definition PatternMatch.h:1849

ElementWiseBitCast_match< OpTy > m_ElementWiseBitCast(const OpTy &Op)

Definition PatternMatch.h:2204

m_Intrinsic_Ty< Opnd0 >::Ty m_FAbs(const Opnd0 &Op0)

Definition PatternMatch.h:2889

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.

Definition PatternMatch.h:3008

m_Intrinsic_Ty< Opnd0, Opnd1 >::Ty m_CopySign(const Opnd0 &Op0, const Opnd1 &Op1)

Definition PatternMatch.h:2952

CastOperator_match< OpTy, Instruction::PtrToInt > m_PtrToInt(const OpTy &Op)

Matches PtrToInt.

Definition PatternMatch.h:2211

m_Intrinsic_Ty< Opnd0, Opnd1, Opnd2 >::Ty m_VectorInsert(const Opnd0 &Op0, const Opnd1 &Op1, const Opnd2 &Op2)

Definition PatternMatch.h:2964

MatchFunctor< Val, Pattern > match_fn(const Pattern &P)

A match functor that can be used as a UnaryPredicate in functional algorithms like all_of.

Definition PatternMatch.h:62

OverflowingBinaryOp_match< LHS, RHS, Instruction::Mul, OverflowingBinaryOperator::NoSignedWrap > m_NSWMul(const LHS &L, const RHS &R)

Definition PatternMatch.h:1450

match_combine_or< match_combine_or< CastInst_match< OpTy, ZExtInst >, CastInst_match< OpTy, TruncInst > >, OpTy > m_ZExtOrTruncOrSelf(const OpTy &Op)

Definition PatternMatch.h:2328

BinaryOp_match< LHS, RHS, Instruction::Sub > m_Sub(const LHS &L, const RHS &R)

Definition PatternMatch.h:1220

MaxMin_match< ICmpInst, LHS, RHS, umin_pred_ty > m_UMin(const LHS &L, const RHS &R)

Definition PatternMatch.h:2542

cstfp_pred_ty< is_noninf > m_NonInf()

Match a non-infinity FP constant, i.e.

Definition PatternMatch.h:747

m_Intrinsic_Ty< Opnd >::Ty m_Deinterleave2(const Opnd &Op)

Definition PatternMatch.h:3225

match_unless< Ty > m_Unless(const Ty &M)

Match if the inner matcher does NOT match.

Definition PatternMatch.h:236

match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)

Combine two pattern matchers matching L || R.

Definition PatternMatch.h:272

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.

Definition PatternMatch.h:712

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 - Return the argument parameter cast to the specified type.

auto dyn_cast_or_null(const Y &Val)

bool isa(const From &Val)

isa - 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 - 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.

Definition PatternMatch.h:84

AllowReassoc_match(const SubPattern_t &SP)

Definition PatternMatch.h:87

SubPattern_t SubPattern

Definition PatternMatch.h:85

bool match(OpTy *V) const

Definition PatternMatch.h:89

Definition PatternMatch.h:1136

RHS_t R

Definition PatternMatch.h:1138

AnyBinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1142

bool match(OpTy *V) const

Definition PatternMatch.h:1144

LHS_t L

Definition PatternMatch.h:1137

Matches instructions with Opcode and any number of operands.

Definition PatternMatch.h:1920

bool match(OpTy *V) const

Definition PatternMatch.h:1941

std::enable_if_t< Idx==Last, bool > match_operands(const Instruction *I) const

Definition PatternMatch.h:1937

std::enable_if_t< Idx !=Last, bool > match_operands(const Instruction *I) const

Definition PatternMatch.h:1931

std::tuple< OperandTypes... > Operands

Definition PatternMatch.h:1921

AnyOps_match(const OperandTypes &...Ops)

Definition PatternMatch.h:1923

Definition PatternMatch.h:1162

OP_t X

Definition PatternMatch.h:1163

AnyUnaryOp_match(const OP_t &X)

Definition PatternMatch.h:1165

bool match(OpTy *V) const

Definition PatternMatch.h:1167

Definition PatternMatch.h:2734

Argument_match(unsigned OpIdx, const Opnd_t &V)

Definition PatternMatch.h:2738

unsigned OpI

Definition PatternMatch.h:2735

Opnd_t Val

Definition PatternMatch.h:2736

bool match(OpTy *V) const

Definition PatternMatch.h:2740

Definition PatternMatch.h:1619

RHS_t R

Definition PatternMatch.h:1621

BinOpPred_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1623

LHS_t L

Definition PatternMatch.h:1620

bool match(OpTy *V) const

Definition PatternMatch.h:1625

Definition PatternMatch.h:1184

BinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1190

RHS_t R

Definition PatternMatch.h:1186

LHS_t L

Definition PatternMatch.h:1185

bool match(OpTy *V) const

Definition PatternMatch.h:1202

bool match(unsigned Opc, OpTy *V) const

Definition PatternMatch.h:1192

Definition PatternMatch.h:2119

CastInst_match(const Op_t &OpMatch)

Definition PatternMatch.h:2122

Op_t Op

Definition PatternMatch.h:2120

bool match(OpTy *V) const

Definition PatternMatch.h:2124

Definition PatternMatch.h:2107

CastOperator_match(const Op_t &OpMatch)

Definition PatternMatch.h:2110

bool match(OpTy *V) const

Definition PatternMatch.h:2112

Op_t Op

Definition PatternMatch.h:2108

Definition PatternMatch.h:1743

RHS_t R

Definition PatternMatch.h:1746

bool match(OpTy *V) const

Definition PatternMatch.h:1755

LHS_t L

Definition PatternMatch.h:1745

CmpClass_match(CmpPredicate &Pred, const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1750

CmpPredicate * Predicate

Definition PatternMatch.h:1744

CmpClass_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1752

Definition PatternMatch.h:3087

RHS R

Definition PatternMatch.h:3089

bool match(OpTy *V) const

Definition PatternMatch.h:3093

CommutativeBinaryIntrinsic_match(const LHS &L, const RHS &R)

Definition PatternMatch.h:3091

LHS L

Definition PatternMatch.h:3088

Definition PatternMatch.h:1528

LHS L

Definition PatternMatch.h:1529

DisjointOr_match(const LHS &L, const RHS &R)

Definition PatternMatch.h:1532

RHS R

Definition PatternMatch.h:1530

bool match(OpTy *V) const

Definition PatternMatch.h:1534

Definition PatternMatch.h:2180

bool match(OpTy *V) const

Definition PatternMatch.h:2185

ElementWiseBitCast_match(const Op_t &OpMatch)

Definition PatternMatch.h:2183

Op_t Op

Definition PatternMatch.h:2181

Definition PatternMatch.h:1721

Exact_match(const SubPattern_t &SP)

Definition PatternMatch.h:1724

SubPattern_t SubPattern

Definition PatternMatch.h:1722

bool match(OpTy *V) const

Definition PatternMatch.h:1726

Definition PatternMatch.h:1231

FNeg_match(const Op_t &Op)

Definition PatternMatch.h:1234

bool match(OpTy *V) const

Definition PatternMatch.h:1235

Op_t X

Definition PatternMatch.h:1232

Matcher for a single index InsertValue instruction.

Definition PatternMatch.h:3193

InsertValue_match(const T0 &Op0, const T1 &Op1)

Definition PatternMatch.h:3197

T0 Op0

Definition PatternMatch.h:3194

bool match(OpTy *V) const

Definition PatternMatch.h:3199

T1 Op1

Definition PatternMatch.h:3195

Intrinsic matchers.

Definition PatternMatch.h:2755

unsigned ID

Definition PatternMatch.h:2756

IntrinsicID_match(Intrinsic::ID IntrID)

Definition PatternMatch.h:2758

bool match(OpTy *V) const

Definition PatternMatch.h:2760

Definition PatternMatch.h:3230

LHS L

Definition PatternMatch.h:3231

LogicalOp_match(const LHS &L, const RHS &R)

Definition PatternMatch.h:3234

bool match(T *V) const

Definition PatternMatch.h:3236

RHS R

Definition PatternMatch.h:3232

Definition PatternMatch.h:53

bool operator()(Val *V) const

Definition PatternMatch.h:56

const Pattern & P

Definition PatternMatch.h:54

MatchFunctor(const Pattern &P)

Definition PatternMatch.h:55

Definition PatternMatch.h:2419

Pred_t PredType

Definition PatternMatch.h:2420

MaxMin_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:2426

LHS_t L

Definition PatternMatch.h:2421

bool match(OpTy *V) const

Definition PatternMatch.h:2428

RHS_t R

Definition PatternMatch.h:2422

Definition PatternMatch.h:2148

NNegZExt_match(const Op_t &OpMatch)

Definition PatternMatch.h:2151

Op_t Op

Definition PatternMatch.h:2149

bool match(OpTy *V) const

Definition PatternMatch.h:2153

Definition PatternMatch.h:2160

NoWrapTrunc_match(const Op_t &OpMatch)

Definition PatternMatch.h:2163

Op_t Op

Definition PatternMatch.h:2161

bool match(OpTy *V) const

Definition PatternMatch.h:2165

Matches instructions with Opcode and three operands.

Definition PatternMatch.h:1864

T0 Op1

Definition PatternMatch.h:1865

bool match(OpTy *V) const

Definition PatternMatch.h:1869

OneOps_match(const T0 &Op1)

Definition PatternMatch.h:1867

Definition PatternMatch.h:70

bool match(OpTy *V) const

Definition PatternMatch.h:75

OneUse_match(const SubPattern_t &SP)

Definition PatternMatch.h:73

SubPattern_t SubPattern

Definition PatternMatch.h:71

Definition PatternMatch.h:1398

bool match(OpTy *V) const

Definition PatternMatch.h:1405

OverflowingBinaryOp_match(const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1402

LHS_t L

Definition PatternMatch.h:1399

RHS_t R

Definition PatternMatch.h:1400

Definition PatternMatch.h:2048

bool match(OpTy *V) const

Definition PatternMatch.h:2055

OffsetOpTy OffsetOp

Definition PatternMatch.h:2050

PointerOpTy PointerOp

Definition PatternMatch.h:2049

PtrAdd_match(const PointerOpTy &PointerOp, const OffsetOpTy &OffsetOp)

Definition PatternMatch.h:2052

Definition PatternMatch.h:2131

PtrToIntSameSize_match(const DataLayout &DL, const Op_t &OpMatch)

Definition PatternMatch.h:2135

bool match(OpTy *V) const

Definition PatternMatch.h:2138

const DataLayout & DL

Definition PatternMatch.h:2132

Op_t Op

Definition PatternMatch.h:2133

Definition PatternMatch.h:1357

ShiftLike_match(const LHS_t &LHS, uint64_t &RHS)

Definition PatternMatch.h:1361

uint64_t & R

Definition PatternMatch.h:1359

bool match(OpTy *V) const

Definition PatternMatch.h:1363

LHS_t L

Definition PatternMatch.h:1358

Matches shuffle.

Definition PatternMatch.h:1997

Shuffle_match(const T0 &Op1, const T1 &Op2, const T2 &Mask)

Definition PatternMatch.h:2002

T0 Op1

Definition PatternMatch.h:1998

T2 Mask

Definition PatternMatch.h:2000

bool match(OpTy *V) const

Definition PatternMatch.h:2005

T1 Op2

Definition PatternMatch.h:1999

Definition PatternMatch.h:3122

bool match(OpTy *V) const

Definition PatternMatch.h:3126

Opnd_t Val

Definition PatternMatch.h:3123

Signum_match(const Opnd_t &V)

Definition PatternMatch.h:3124

Definition PatternMatch.h:1509

bool match(OpTy *V) const

Definition PatternMatch.h:1515

SpecificBinaryOp_match(unsigned Opcode, const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1512

unsigned Opcode

Definition PatternMatch.h:1510

Definition PatternMatch.h:1810

RHS_t R

Definition PatternMatch.h:1813

LHS_t L

Definition PatternMatch.h:1812

bool match(OpTy *V) const

Definition PatternMatch.h:1818

SpecificCmpClass_match(CmpPredicate Pred, const LHS_t &LHS, const RHS_t &RHS)

Definition PatternMatch.h:1815

const CmpPredicate Predicate

Definition PatternMatch.h:1811

Definition PatternMatch.h:201

bool match(OpTy *V) const

Definition PatternMatch.h:205

Splat_match(const SubPattern_t &SP)

Definition PatternMatch.h:203

SubPattern_t SubPattern

Definition PatternMatch.h:202

Matches instructions with Opcode and three operands.

Definition PatternMatch.h:1897

T0 Op1

Definition PatternMatch.h:1898

ThreeOps_match(const T0 &Op1, const T1 &Op2, const T2 &Op3)

Definition PatternMatch.h:1902

bool match(OpTy *V) const

Definition PatternMatch.h:1905

T2 Op3

Definition PatternMatch.h:1900

T1 Op2

Definition PatternMatch.h:1899

Matches instructions with Opcode and three operands.

Definition PatternMatch.h:1879

TwoOps_match(const T0 &Op1, const T1 &Op2)

Definition PatternMatch.h:1883

T0 Op1

Definition PatternMatch.h:1880

T1 Op2

Definition PatternMatch.h:1881

bool match(OpTy *V) const

Definition PatternMatch.h:1885

Definition PatternMatch.h:2666

bool match(OpTy *V) const

Definition PatternMatch.h:2674

UAddWithOverflow_match(const LHS_t &L, const RHS_t &R, const Sum_t &S)

Definition PatternMatch.h:2671

RHS_t R

Definition PatternMatch.h:2668

LHS_t L

Definition PatternMatch.h:2667

Sum_t S

Definition PatternMatch.h:2669

Definition PatternMatch.h:1587

RHS R

Definition PatternMatch.h:1589

LHS L

Definition PatternMatch.h:1588

XorLike_match(const LHS &L, const RHS &R)

Definition PatternMatch.h:1591

bool match(OpTy *V) const

Definition PatternMatch.h:1593

Definition PatternMatch.h:282

ap_match(const APTy *&Res, bool AllowPoison)

Definition PatternMatch.h:290

std::conditional_t< std::is_same_v< APTy, APInt >, ConstantInt, ConstantFP > ConstantTy

Definition PatternMatch.h:284

const APTy *& Res

Definition PatternMatch.h:287

bool AllowPoison

Definition PatternMatch.h:288

bool match(ITy *V) const

Definition PatternMatch.h:293

This helper class is used to match scalar and vector constants that satisfy a specified predicate,...

Definition PatternMatch.h:452

apf_pred_ty(const APFloat *&R)

Definition PatternMatch.h:455

bool match(ITy *V) const

Definition PatternMatch.h:457

const APFloat *& Res

Definition PatternMatch.h:453

This helper class is used to match scalar and vector constants that satisfy a specified predicate,...

Definition PatternMatch.h:425

api_pred_ty(const APInt *&R)

Definition PatternMatch.h:428

const APInt *& Res

Definition PatternMatch.h:426

bool match(ITy *V) const

Definition PatternMatch.h:430

Check whether the value has the given Class and matches the nested pattern.

Definition PatternMatch.h:839

Class *& VR

Definition PatternMatch.h:840

MatchTy Match

Definition PatternMatch.h:841

bind_and_match_ty(Class *&V, const MatchTy &Match)

Definition PatternMatch.h:843

bool match(ITy *V) const

Definition PatternMatch.h:845

Definition PatternMatch.h:1036

uint64_t & VR

Definition PatternMatch.h:1037

bool match(ITy *V) const

Definition PatternMatch.h:1041

bind_const_intval_ty(uint64_t &V)

Definition PatternMatch.h:1039

Definition PatternMatch.h:959

bool match(ITy *V) const

Definition PatternMatch.h:964

Constant *& VR

Definition PatternMatch.h:960

bind_immconstant_ty(Constant *&V)

Definition PatternMatch.h:962

Definition PatternMatch.h:823

bool match(ITy *V) const

Definition PatternMatch.h:828

bind_ty(Class *&V)

Definition PatternMatch.h:826

Class *& VR

Definition PatternMatch.h:824

Definition PatternMatch.h:2366

bool match(OpTy *V) const

Definition PatternMatch.h:2371

BasicBlock *& Succ

Definition PatternMatch.h:2367

br_match(BasicBlock *&Succ)

Definition PatternMatch.h:2369

Definition PatternMatch.h:2384

FalseBlock_t F

Definition PatternMatch.h:2387

Cond_t Cond

Definition PatternMatch.h:2385

brc_match(const Cond_t &C, const TrueBlock_t &t, const FalseBlock_t &f)

Definition PatternMatch.h:2389

TrueBlock_t T

Definition PatternMatch.h:2386

bool match(OpTy *V) const

Definition PatternMatch.h:2392

Definition PatternMatch.h:100

bool match(ITy *V) const

Definition PatternMatch.h:101

Definition PatternMatch.h:190

bool match(ITy *V) const

Definition PatternMatch.h:191

Definition PatternMatch.h:343

bool match(ITy *V) const

Definition PatternMatch.h:344

This helper class is used to match constant scalars, vector splats, and fixed width vectors that sati...

Definition PatternMatch.h:368

bool match(ITy *V) const

Definition PatternMatch.h:404

const Constant ** Res

Definition PatternMatch.h:369

bool match_impl(ITy *V) const

Definition PatternMatch.h:370

Definition PatternMatch.h:485

bool isValue(const APTy &C) const

Definition PatternMatch.h:487

function_ref< bool(const APTy &)> CheckFn

Definition PatternMatch.h:486

Stores a reference to the Value *, not the Value * itself, thus can be used in commutative matchers.

Definition PatternMatch.h:992

Class *const & Val

Definition PatternMatch.h:993

deferredval_ty(Class *const &V)

Definition PatternMatch.h:995

bool match(ITy *const V) const

Definition PatternMatch.h:997

Definition PatternMatch.h:702

CmpPredicate Pred

Definition PatternMatch.h:703

bool isValue(const APInt &C) const

Definition PatternMatch.h:705

const APInt * Thr

Definition PatternMatch.h:704

Definition PatternMatch.h:933

static bool isImmConstant(ITy *V)

Definition PatternMatch.h:934

Definition PatternMatch.h:531

bool isValue(const APInt &C) const

Definition PatternMatch.h:532

Definition PatternMatch.h:514

bool isValue(const APInt &C) const

Definition PatternMatch.h:515

Definition PatternMatch.h:773

bool isValue(const APFloat &C) const

Definition PatternMatch.h:774

Definition PatternMatch.h:1651

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1652

Definition PatternMatch.h:751

bool isValue(const APFloat &C) const

Definition PatternMatch.h:752

Definition PatternMatch.h:761

bool isValue(const APFloat &C) const

Definition PatternMatch.h:762

Definition PatternMatch.h:1657

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1658

Definition PatternMatch.h:735

bool isValue(const APFloat &C) const

Definition PatternMatch.h:736

Definition PatternMatch.h:1663

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1664

Definition PatternMatch.h:1645

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1646

Definition PatternMatch.h:690

bool isValue(const APInt &C) const

Definition PatternMatch.h:691

Definition PatternMatch.h:680

bool isValue(const APInt &C) const

Definition PatternMatch.h:681

Definition PatternMatch.h:544

bool isValue(const APInt &C) const

Definition PatternMatch.h:545

Definition PatternMatch.h:719

bool isValue(const APFloat &C) const

Definition PatternMatch.h:720

Definition PatternMatch.h:791

bool isValue(const APFloat &C) const

Definition PatternMatch.h:792

Definition PatternMatch.h:646

bool isValue(const APInt &C) const

Definition PatternMatch.h:647

Definition PatternMatch.h:634

bool isValue(const APInt &C) const

Definition PatternMatch.h:635

Definition PatternMatch.h:557

bool isValue(const APInt &C) const

Definition PatternMatch.h:558

Definition PatternMatch.h:800

bool isValue(const APFloat &C) const

Definition PatternMatch.h:801

Definition PatternMatch.h:809

bool isValue(const APFloat &C) const

Definition PatternMatch.h:810

Definition PatternMatch.h:742

bool isValue(const APFloat &C) const

Definition PatternMatch.h:743

Definition PatternMatch.h:726

bool isValue(const APFloat &C) const

Definition PatternMatch.h:727

Definition PatternMatch.h:567

bool isValue(const APInt &C) const

Definition PatternMatch.h:568

Definition PatternMatch.h:589

bool isValue(const APInt &C) const

Definition PatternMatch.h:590

Definition PatternMatch.h:599

bool isValue(const APInt &C) const

Definition PatternMatch.h:600

Definition PatternMatch.h:782

bool isValue(const APFloat &C) const

Definition PatternMatch.h:783

Definition PatternMatch.h:659

bool isValue(const APInt &C) const

Definition PatternMatch.h:660

Definition PatternMatch.h:626

bool isValue(const APInt &C) const

Definition PatternMatch.h:627

Definition PatternMatch.h:1639

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1640

Definition PatternMatch.h:1635

bool isOpType(unsigned Opcode) const

Definition PatternMatch.h:1636

Definition PatternMatch.h:523

bool isValue(const APInt &C) const

Definition PatternMatch.h:524

Definition PatternMatch.h:671

bool isValue(const APInt &C) const

Definition PatternMatch.h:672

Definition PatternMatch.h:577

bool isValue(const APInt &C) const

Definition PatternMatch.h:578

Definition PatternMatch.h:606

bool isValue(const APInt &C) const

Definition PatternMatch.h:607

Definition PatternMatch.h:615

bool match(ITy *V) const

Definition PatternMatch.h:616

match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2, T3, T4 >::Ty, Argument_match< T5 > > Ty

Definition PatternMatch.h:2804

match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2, T3 >::Ty, Argument_match< T4 > > Ty

Definition PatternMatch.h:2797

match_combine_and< typename m_Intrinsic_Ty< T0, T1, T2 >::Ty, Argument_match< T3 > > Ty

Definition PatternMatch.h:2791

match_combine_and< typename m_Intrinsic_Ty< T0, T1 >::Ty, Argument_match< T2 > > Ty

Definition PatternMatch.h:2786

match_combine_and< typename m_Intrinsic_Ty< T0 >::Ty, Argument_match< T1 > > Ty

Definition PatternMatch.h:2781

match_combine_and< IntrinsicID_match, Argument_match< T0 > > Ty

Definition PatternMatch.h:2778

Intrinsic matches are combinations of ID matchers, and argument matchers.

Definition PatternMatch.h:2776

ArrayRef< int > & MaskRef

Definition PatternMatch.h:2015

m_Mask(ArrayRef< int > &MaskRef)

Definition PatternMatch.h:2016

bool match(ArrayRef< int > Mask) const

Definition PatternMatch.h:2017

ArrayRef< int > Val

Definition PatternMatch.h:2030

bool match(ArrayRef< int > Mask) const

Definition PatternMatch.h:2032

m_SpecificMask(ArrayRef< int > Val)

Definition PatternMatch.h:2031

int & SplatIndex

Definition PatternMatch.h:2036

bool match(ArrayRef< int > Mask) const

Definition PatternMatch.h:2038

m_SplatOrPoisonMask(int &SplatIndex)

Definition PatternMatch.h:2037

Definition PatternMatch.h:2023

bool match(ArrayRef< int > Mask) const

Definition PatternMatch.h:2024

Definition PatternMatch.h:256

IntrinsicID_match L

Definition PatternMatch.h:257

match_combine_and(const LTy &Left, const RTy &Right)

Definition PatternMatch.h:260

Argument_match< T0 > R

Definition PatternMatch.h:258

bool match(ITy *V) const

Definition PatternMatch.h:262

Matching combinators.

Definition PatternMatch.h:241

match_combine_or(const LTy &Left, const RTy &Right)

Definition PatternMatch.h:245

LTy L

Definition PatternMatch.h:242

RTy R

Definition PatternMatch.h:243

bool match(ITy *V) const

Definition PatternMatch.h:247

Definition PatternMatch.h:952

bool match(ITy *V) const

Definition PatternMatch.h:953

Inverting matcher.

Definition PatternMatch.h:227

bool match(ITy *V) const

Definition PatternMatch.h:232

Ty M

Definition PatternMatch.h:228

match_unless(const Ty &Matcher)

Definition PatternMatch.h:230

Helper class for identifying ordered max predicates.

Definition PatternMatch.h:2496

static bool match(FCmpInst::Predicate Pred)

Definition PatternMatch.h:2497

Helper class for identifying ordered min predicates.

Definition PatternMatch.h:2503

static bool match(FCmpInst::Predicate Pred)

Definition PatternMatch.h:2504

Helper class for identifying signed max predicates.

Definition PatternMatch.h:2468

static bool match(ICmpInst::Predicate Pred)

Definition PatternMatch.h:2469

Helper class for identifying signed min predicates.

Definition PatternMatch.h:2475

static bool match(ICmpInst::Predicate Pred)

Definition PatternMatch.h:2476

Match a specified basic block value.

Definition PatternMatch.h:1107

bool match(ITy *V) const

Definition PatternMatch.h:1112

specific_bbval(BasicBlock *Val)

Definition PatternMatch.h:1110

BasicBlock * Val

Definition PatternMatch.h:1108

Match a specified floating point value or vector of all elements of that value.

Definition PatternMatch.h:1013

bool match(ITy *V) const

Definition PatternMatch.h:1018

specific_fpval(double V)

Definition PatternMatch.h:1016

double Val

Definition PatternMatch.h:1014

Definition PatternMatch.h:1069

uint64_t Val

Definition PatternMatch.h:1070

specific_intval64(uint64_t V)

Definition PatternMatch.h:1072

bool match(ITy *V) const

Definition PatternMatch.h:1074

Match a specified integer value or vector of all elements of that value.

Definition PatternMatch.h:1054

specific_intval(const APInt &V)

Definition PatternMatch.h:1057

bool match(ITy *V) const

Definition PatternMatch.h:1059

const APInt & Val

Definition PatternMatch.h:1055

Match a specified Value*.

Definition PatternMatch.h:979

bool match(ITy *V) const

Definition PatternMatch.h:984

const Value * Val

Definition PatternMatch.h:980

specificval_ty(const Value *V)

Definition PatternMatch.h:982

Helper class for identifying unordered max predicates.

Definition PatternMatch.h:2510

static bool match(FCmpInst::Predicate Pred)

Definition PatternMatch.h:2511

Helper class for identifying unordered min predicates.

Definition PatternMatch.h:2517

static bool match(FCmpInst::Predicate Pred)

Definition PatternMatch.h:2518

Helper class for identifying unsigned max predicates.

Definition PatternMatch.h:2482

static bool match(ICmpInst::Predicate Pred)

Definition PatternMatch.h:2483

Helper class for identifying unsigned min predicates.

Definition PatternMatch.h:2489

static bool match(ICmpInst::Predicate Pred)

Definition PatternMatch.h:2490

Definition PatternMatch.h:120

bool match(ITy *V) const

Definition PatternMatch.h:159

static bool check(const Value *V)

Definition PatternMatch.h:121