LLVM: include/llvm/CodeGen/SelectionDAGNodes.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
19#define LLVM_CODEGEN_SELECTIONDAGNODES_H
20
47#include
48#include
49#include
50#include
51#include
52#include
53#include
54#include
55#include
56#include
57
58namespace llvm {
59
60class APInt;
62class GlobalValue;
63class MachineBasicBlock;
64class MachineConstantPoolValue;
66class raw_ostream;
67class SDNode;
68class SelectionDAG;
71
72void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
73 bool force = false);
74
75
76
77
78
82};
83
84namespace ISD {
85
86
87
88
89
90
92
93
94
95
97 bool BuildVectorOnly = false);
98
99
100
101
103 bool BuildVectorOnly = false);
104
105
106
108
109
110
112
113
114
116
117
118
120
121
122
124
125
126
128
129
131
132}
133
134
135
136
137
138
139
140
141
142
143
144
147
149 unsigned ResNo = 0;
150
151public:
154
155
156 unsigned getResNo() const { return ResNo; }
157
158
160
161
163
165
167 return Node == O.Node && ResNo == O.ResNo;
168 }
171 }
173 return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
174 }
175 explicit operator bool() const {
176 return Node != nullptr;
177 }
178
181 }
182
183
185
186
188
189
192 }
193
194
195
196
197
198
201 }
202
205 }
206
207
208 inline unsigned getOpcode() const;
215 inline bool isUndef() const;
218 inline void dump() const;
220 inline void dumpr() const;
222
223
224
225
226
227
229 unsigned Depth = 2) const;
230
231
233
234
236};
237
241 V.ResNo = -1U;
242 return V;
243 }
244
247 V.ResNo = -2U;
248 return V;
249 }
250
252 return ((unsigned)((uintptr_t)Val.getNode() >> 4) ^
253 (unsigned)((uintptr_t)Val.getNode() >> 9)) + Val.getResNo();
254 }
255
258 }
259};
260
261
262
265
268 }
269};
272
275 }
276};
277
278
279
280
281
282
284
286
288
289
290 SDUse **Prev = nullptr;
291 SDUse *Next = nullptr;
292
293public:
297
298
299 operator const SDValue&() const { return Val; }
300
301
302
304
305
308
309
311
312
314
315
317
319
321
322
324 return Val == V;
325 }
326
327
329 return Val != V;
330 }
331
332
334 return Val < V;
335 }
336
337private:
340
342
343 void setUser(SDNode *p) { User = p; }
344
345
346
347 inline void set(const SDValue &V);
348
349
350 inline void setInitial(const SDValue &V);
351
352
353 inline void setNode(SDNode *N);
354
356 Next = *List;
357 if (Next) Next->Prev = &Next;
359 *List = this;
360 }
361
362 void removeFromList() {
363 *Prev = Next;
364 if (Next) Next->Prev = Prev;
365 }
366};
367
368
369
372
375 }
376};
377
378
379
380
382private:
384
385 unsigned Flags = 0;
386
387 template void setFlag(bool B) {
388 Flags = (Flags & ~Flag) | (B ? Flag : 0);
389 }
390
391public:
392 enum : unsigned {
407
408
409
410
411
412
414
416
418
419
420
421
424 };
425
426
428
429
438 }
439
440
443 void setExact(bool b) { setFlag(b); }
446 void setNonNeg(bool b) { setFlag(b); }
447 void setNoNaNs(bool b) { setFlag(b); }
448 void setNoInfs(bool b) { setFlag(b); }
456
457
473
475 return Flags == Other.Flags;
476 }
479};
480
483
486 return LHS;
487}
488
491 return LHS;
492}
493
494
495
497private:
498
499 int32_t NodeType;
500
502
503protected:
504
505
506
507
508#if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
509
510
511#define BEGIN_TWO_BYTE_PACK() _Pragma("pack(2)")
512#define END_TWO_BYTE_PACK() _Pragma("pack(pop)")
513#else
514#define BEGIN_TWO_BYTE_PACK()
515#define END_TWO_BYTE_PACK()
516#endif
517
524
528 };
530
533
535
537 };
538
543
545
548 uint16_t IsDereferenceable : 1;
550 };
552
560
562
563
564
565
566
567
568
569
570
572 };
574
584
586
587 uint16_t ExtTy : 2;
589 };
590
598
600
603 };
604
605 union {
613 };
615#undef BEGIN_TWO_BYTE_PACK
616#undef END_TWO_BYTE_PACK
617
618
619
620
621 static_assert(sizeof(SDNodeBitfields) <= 2, "field too wide");
622 static_assert(sizeof(ConstantSDNodeBitfields) <= 2, "field too wide");
623 static_assert(sizeof(MemSDNodeBitfields) <= 2, "field too wide");
624 static_assert(sizeof(LSBaseSDNodeBitfields) <= 2, "field too wide");
625 static_assert(sizeof(LoadSDNodeBitfields) <= 2, "field too wide");
626 static_assert(sizeof(StoreSDNodeBitfields) <= 2, "field too wide");
627
628public:
629
630
631
632
633
635
636private:
638
640
641
642 int NodeId = -1;
643
644
645 SDUse *OperandList = nullptr;
646
647
648
649 const EVT *ValueList;
650
651
652 SDUse *UseList = nullptr;
653
654
655 unsigned short NumOperands = 0;
656 unsigned short NumValues;
657
658
659
660
661
662
663 unsigned IROrder;
664
665
667
668
669 static const EVT *getValueTypeList(MVT VT);
670
671
672
673
674 int CombinerWorklistIndex = -1;
675
677
678public:
679
680
681
682
683
684
685
686
687 unsigned getOpcode() const { return (unsigned)NodeType; }
688
689
690
692
693
695
696
698
699
701 switch (NodeType) {
702 default:
703 return false;
708#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
709 case ISD::STRICT_##DAGN:
710#include "llvm/IR/ConstrainedOps.def"
711 return true;
712 }
713 }
714
715
717
718
719
721
722
723
724
727 return ~NodeType;
728 }
729
732
734
735
736 bool use_empty() const { return UseList == nullptr; }
737
738
740
741
742
744
745
747
748
750
751
753
754
756
757
759
760
761 void setIROrder(unsigned Order) { IROrder = Order; }
762
763
765
766
767
769
770
771
774
776
778
779 public:
785
789
793 }
794
795
797 assert(Op && "Cannot increment end iterator!");
799 return *this;
800 }
801
803 use_iterator tmp = *this; ++*this; return tmp;
804 }
805
806
808 assert(Op && "Cannot dereference end iterator!");
809 return *Op;
810 }
811
813 };
814
818
820
821 public:
827
829
832
834 ++UI;
835 return *this;
836 }
837
839 auto tmp = *this;
840 ++*this;
841 return tmp;
842 }
843
844
846
848
850 };
851
852
855 }
856
858
861 }
864 }
865
866
868
870
873 }
876 }
877
878
879
881
882
883
885
886
888
889
891
892
893
894
896 return N->hasPredecessor(this);
897 }
898
899
900
901
902
904
905
906
907
908
909
910
911
912
913
918 bool TopologicalPrune = false) {
920 return true;
921
923
924
925
926
927
928
929
930
931
932
933
934 int NId = N->getNodeId();
935
936 if (NId < -1)
937 NId = -(NId + 1);
938
939 bool Found = false;
940 while (!Worklist.empty()) {
942 int MId = M->getNodeId();
943 if (TopologicalPrune && M->getOpcode() != ISD::TokenFactor && (NId > 0) &&
944 (MId > 0) && (MId < NId)) {
946 continue;
947 }
948 for (const SDValue &OpV : M->op_values()) {
950 if (Visited.insert(Op).second)
953 Found = true;
954 }
955 if (Found)
956 break;
958 break;
959 }
960
961 Worklist.append(DeferredNodes.begin(), DeferredNodes.end());
962
964 return true;
965 return Found;
966 }
967
968
969
971
972
974
975
977 return std::numeric_limits<decltype(SDNode::NumOperands)>::max();
978 }
979
980
982
983
985
986
988
989
991
993 assert(Num < NumOperands && "Invalid child # of SDNode!");
994 return OperandList[Num];
995 }
996
998
1002
1003
1006 std::random_access_iterator_tag, SDValue,
1007 ptrdiff_t, value_op_iterator *,
1008 value_op_iterator *> {
1011
1013 };
1014
1018 }
1019
1021 SDVTList X = { ValueList, NumValues };
1022 return X;
1023 }
1024
1025
1026
1031 return nullptr;
1032 }
1033
1034
1035
1038 if (U.getValueType() == MVT::Glue)
1039 return U.getUser();
1040 return nullptr;
1041 }
1042
1045 void dropFlags(unsigned Mask) { Flags &= ~Mask; }
1046
1047
1048
1050
1053 }
1054
1057
1058
1060
1061
1063 assert(ResNo < NumValues && "Illegal result number!");
1064 return ValueList[ResNo];
1065 }
1066
1067
1070 }
1071
1072
1073
1074
1075
1076
1079 }
1080
1082
1087 }
1088
1089
1096
1097
1098
1099
1100
1101
1102
1104
1105
1106
1107
1108
1109
1110
1112 unsigned depth = 100) const;
1113
1114
1115 void dump() const;
1116
1117
1118 void dumpr() const;
1119
1120
1121
1122
1124
1125
1126
1127
1129
1130
1131
1132
1133
1135
1136
1137
1138
1139
1140
1142 unsigned depth = 100) const;
1143
1144
1146
1147
1149
1150protected:
1152 SDVTList Ret = { getValueTypeList(VT), 1 };
1153 return Ret;
1154 }
1155
1156
1157
1158
1159
1161 : NodeType(Opc), ValueList(VTs.VTs), NumValues(VTs.NumVTs),
1162 IROrder(Order), debugLoc(std::move(dl)) {
1166 "NumValues wasn't wide enough for its operands!");
1167 }
1168
1169
1171};
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1183private:
1185 int IROrder = 0;
1186
1187public:
1192 assert(Order >= 0 && "bad IROrder");
1193 if (I)
1195 }
1196
1199};
1200
1201
1202
1204 : Node(node), ResNo(resno) {
1205
1206
1207
1208 assert(( || !ResNo || ResNo < Node->getNumValues()) &&
1209 "Invalid result number for the given node!");
1210 assert(ResNo < -2U && "Cannot use result numbers reserved for DenseMaps.");
1211}
1212
1214 return Node->getOpcode();
1215}
1216
1218 return Node->getValueType(ResNo);
1219}
1220
1222 return Node->getNumOperands();
1223}
1224
1226 return Node->getOperand(i);
1227}
1228
1230 return Node->getConstantOperandVal(i);
1231}
1232
1234 return Node->getConstantOperandAPInt(i);
1235}
1236
1238 return Node->isTargetOpcode();
1239}
1240
1242 return Node->isMachineOpcode();
1243}
1244
1246 return Node->getMachineOpcode();
1247}
1248
1250 return Node->isUndef();
1251}
1252
1254 return ->hasAnyUseOfValue(ResNo);
1255}
1256
1258 return Node->hasNUsesOfValue(1, ResNo);
1259}
1260
1262 return Node->getDebugLoc();
1263}
1264
1267}
1268
1271}
1272
1274 return Node->dumpr();
1275}
1276
1279}
1280
1281
1284}
1285
1286inline void SDUse::set(const SDValue &V) {
1287 if (Val.getNode()) removeFromList();
1288 Val = V;
1289 if (V.getNode())
1290 V->addUse(*this);
1291}
1292
1293inline void SDUse::setInitial(const SDValue &V) {
1294 Val = V;
1295 V->addUse(*this);
1296}
1297
1298inline void SDUse::setNode(SDNode *N) {
1299 if (Val.getNode()) removeFromList();
1302}
1303
1304
1305
1306
1307
1310
1311public:
1314
1315
1317
1318
1319
1320
1321
1322 Op.setUser(this);
1324 NumOperands = 1;
1325 OperandList = &Op;
1326 }
1328
1330};
1331
1333private:
1334 unsigned SrcAddrSpace;
1335 unsigned DestAddrSpace;
1336
1337public:
1339 unsigned SrcAS, unsigned DestAS)
1340 : SDNode(ISD::ADDRSPACECAST, Order, dl, VTs), SrcAddrSpace(SrcAS),
1341 DestAddrSpace(DestAS) {}
1342
1345
1348 }
1349};
1350
1351
1353private:
1354
1355 EVT MemoryVT;
1356
1357protected:
1358
1360
1361public:
1364
1367
1368
1371
1372
1373
1374
1375
1376
1377
1380 union {
1383 };
1388 return Data;
1389 }
1390
1395
1396
1398
1399
1401
1402
1404
1405
1407
1408
1409
1410
1413 }
1414
1415
1416
1417
1419
1420
1422
1423
1424
1425
1427
1428
1430
1431
1433
1434
1435
1437
1440 }
1441
1442
1445 }
1446
1447
1448
1449
1450
1453 }
1454
1456
1461 case ISD::VP_STORE:
1463 case ISD::VP_SCATTER:
1464 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1470 default:
1472 }
1473 }
1474
1475
1477
1478
1479 switch (N->getOpcode()) {
1510 case ISD::VP_LOAD:
1511 case ISD::VP_STORE:
1512 case ISD::VP_GATHER:
1513 case ISD::VP_SCATTER:
1514 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
1515 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1519 return true;
1520 default:
1521 return N->isMemIntrinsic();
1522 }
1523 }
1524};
1525
1526
1528public:
1531 : MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1533 MMO->isAtomic()) && "then why are we using an AtomicSDNode?");
1534 }
1535
1539 }
1540
1544 }
1545
1548 }
1551 }
1552
1553
1554
1559 }
1560
1561
1562
1566 }
1567
1568
1594 }
1595};
1596
1597
1598
1599
1600
1602public:
1605 : MemSDNode(Opc, Order, dl, VTs, MemoryVT, MMO) {
1607 }
1608
1609
1611
1612
1613 return N->isMemIntrinsic();
1614 }
1615};
1616
1617
1618
1619
1620
1621
1622
1623
1624
1626
1627
1628 const int *Mask;
1629
1630protected:
1632
1634 const int *M)
1635 : SDNode(ISD::VECTOR_SHUFFLE, Order, dl, VTs), Mask(M) {}
1636
1637public:
1641 }
1642
1645 return Mask[Idx];
1646 }
1647
1649
1651 assert(isSplat() && "Cannot get splat index for non-splat!");
1654 if (Mask[i] >= 0)
1655 return Mask[i];
1656
1657
1658
1659 return 0;
1660 }
1661
1663
1664
1665
1667 unsigned NumElems = Mask.size();
1668 for (unsigned i = 0; i != NumElems; ++i) {
1669 int idx = Mask[i];
1670 if (idx < 0)
1671 continue;
1672 else if (idx < (int)NumElems)
1673 Mask[i] = idx + NumElems;
1674 else
1675 Mask[i] = idx - NumElems;
1676 }
1677 }
1678
1681 }
1682};
1683
1686
1688
1692 VTs),
1694 assert(!isa(val->getType()) && "Unexpected vector type!");
1696 }
1697
1698public:
1704 return Value->getLimitedValue(Limit);
1705 }
1708
1714
1716
1720 }
1721};
1722
1724 return cast(getOperand(Num))->getZExtValue();
1725}
1726
1728 return cast(this)->getZExtValue();
1729}
1730
1732 return cast(getOperand(Num))->getAPIntValue();
1733}
1734
1736 return cast(this)->getAPIntValue();
1737}
1738
1741
1743
1745 : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, 0,
1748 assert(!isa(val->getType()) && "Unexpected vector type!");
1749 }
1750
1751public:
1754
1755
1757
1758
1760
1761
1763
1764
1766
1767
1768
1769
1770
1771
1772
1773
1774
1776 return Value->getValueAPF().isExactlyValue(V);
1777 }
1779
1781
1785 }
1786};
1787
1788
1790
1791
1793
1794
1796
1797
1799
1800
1802
1803
1805
1806
1807
1808
1809bool isNeutralConstant(unsigned Opc, SDNodeFlags Flags, SDValue V,
1810 unsigned OperandNo);
1811
1812
1813
1815
1816
1817
1819
1820
1821
1823
1824
1825
1827
1828
1829
1830bool isBitwiseNot(SDValue V, bool AllowUndefs = false);
1831
1832
1833
1834
1836
1837
1839 bool AllowTruncation = false);
1840
1841
1842
1844 bool AllowUndefs = false,
1845 bool AllowTruncation = false);
1846
1847
1849
1850
1851
1853 bool AllowUndefs = false);
1854
1855
1856
1857
1859
1860
1861
1862
1863
1864bool isOneOrOneSplat(SDValue V, bool AllowUndefs = false);
1865
1866
1867
1868
1870
1871
1873 return isa(V) || isa(V);
1874}
1875
1878
1881 unsigned TargetFlags;
1882
1885 unsigned TF)
1886 : SDNode(Opc, Order, DL, VTs), TheGlobal(GA), Offset(o), TargetFlags(TF) {
1887 }
1888
1889public:
1893
1895
1901 }
1902};
1903
1906
1907 int FI;
1908
1910 : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, 0, DebugLoc(),
1911 VTs),
1912 FI(fi) {}
1913
1914public:
1916
1920 }
1921};
1922
1923
1924
1927 int64_t Size;
1928 int64_t Offset;
1929
1933public:
1935 return cast(getOperand(1))->getIndex();
1936 }
1937
1942 }
1945 return Size;
1946 }
1947
1948
1952 }
1953};
1954
1955
1956
1957
1958
1964
1969
1970public:
1974
1975
1978 }
1979};
1980
1983
1984 int JTI;
1985 unsigned TargetFlags;
1986
1988 : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, 0, DebugLoc(),
1989 VTs),
1990 JTI(jti), TargetFlags(TF) {}
1991
1992public:
1995
1999 }
2000};
2001
2004
2005 union {
2008 } Val;
2009 int Offset;
2010 Align Alignment;
2011 unsigned TargetFlags;
2012
2014 Align Alignment, unsigned TF)
2017 Offset(o), Alignment(Alignment), TargetFlags(TF) {
2018 assert(Offset >= 0 && "Offset is too large");
2019 Val.ConstVal = c;
2020 }
2021
2022 ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v, SDVTList VTs,
2023 int o, Align Alignment, unsigned TF)
2024 : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
2025 DebugLoc(), VTs),
2026 Offset(o), Alignment(Alignment), TargetFlags(TF) {
2027 assert(Offset >= 0 && "Offset is too large");
2028 Val.MachineCPVal = v;
2029 Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
2030 }
2031
2032public:
2034 return Offset < 0;
2035 }
2036
2039 return Val.ConstVal;
2040 }
2041
2044 return Val.MachineCPVal;
2045 }
2046
2048 return Offset & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
2049 }
2050
2051
2052
2055
2057
2061 }
2062};
2063
2064
2067
2068 unsigned TargetFlags;
2071
2072public:
2074 : SDNode(ISD::TargetIndex, 0, DebugLoc(), VTs), TargetFlags(TF),
2076
2080
2083 }
2084};
2085
2088
2090
2091
2092
2093
2096 {}
2097
2098public:
2100
2103 }
2104};
2105
2106
2108public:
2109
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2122 unsigned &SplatBitSize, bool &HasAnyUndefs,
2123 unsigned MinSplatBits = 0,
2125
2126
2127
2128
2129
2130
2131
2133 BitVector *UndefElements = nullptr) const;
2134
2135
2136
2137
2138
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2154 BitVector *UndefElements = nullptr) const;
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2166 BitVector *UndefElements = nullptr) const;
2167
2168
2169
2170
2171
2172
2173
2176 BitVector *UndefElements = nullptr) const;
2177
2178
2179
2180
2181
2182
2185
2186
2187
2188
2189
2190
2191
2194 BitVector *UndefElements = nullptr) const;
2195
2196
2197
2198
2199
2200
2203
2204
2205
2206
2207
2208
2211
2212
2213
2214
2215
2216 bool getConstantRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits,
2218 BitVector &UndefElements) const;
2219
2221
2222
2223
2224
2226
2227
2228
2229
2230 static void recastRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits,
2234 const BitVector &SrcUndefElements);
2235
2238 }
2239};
2240
2241
2242
2243
2244
2247
2249
2250
2253
2254public:
2255
2257
2260 }
2261};
2262
2265
2267
2270 {}
2271
2272public:
2274
2277 }
2278};
2279
2282
2284
2287
2288public:
2290
2293 }
2294};
2295
2298
2299
2301
2304 RegMask(mask) {}
2305
2306public:
2308
2311 }
2312};
2313
2316
2319 unsigned TargetFlags;
2320
2322 int64_t o, unsigned Flags)
2324 TargetFlags(Flags) {}
2325
2326public:
2330
2334 }
2335};
2336
2339
2341
2345 }
2346
2347public:
2349
2353 }
2354};
2355
2358
2359 const char *Symbol;
2360 unsigned TargetFlags;
2361
2364 : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, 0,
2366 Symbol(Sym), TargetFlags(TF) {}
2367
2368public:
2369 const char *getSymbol() const { return Symbol; }
2371
2375 }
2376};
2377
2380
2382
2385
2386public:
2388
2391 }
2392};
2393
2396
2398
2401 Condition(Cond) {}
2402
2403public:
2405
2408 }
2409};
2410
2411
2412
2415
2417
2421
2422public:
2424
2427 }
2428};
2429
2430
2432public:
2436 : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2439 }
2440
2443 }
2444
2445
2446
2449 }
2450
2451
2453
2454
2456
2458 return N->getOpcode() == ISD::LOAD ||
2460 }
2461};
2462
2463
2466
2470 : LSBaseSDNode(ISD::LOAD, Order, dl, VTs, AM, MemVT, MMO) {
2472 assert(readMem() && "Load MachineMemOperand is not a load!");
2473 assert(() && "Load MachineMemOperand is a store!");
2474 }
2475
2476public:
2477
2478
2481 }
2482
2485
2488 }
2489};
2490
2491
2494
2498 : LSBaseSDNode(ISD::STORE, Order, dl, VTs, AM, MemVT, MMO) {
2500 assert(() && "Store MachineMemOperand is a load!");
2501 assert(writeMem() && "Store MachineMemOperand is not a store!");
2502 }
2503
2504public:
2505
2506
2507
2511 }
2512
2516
2519 }
2520};
2521
2522
2523
2525public:
2527
2535 }
2536
2537
2538
2539
2540
2541
2542
2546 ? 2
2547 : 3);
2548 }
2552 ? 1
2553 : 2);
2554 }
2557 default:
2559 case ISD::VP_LOAD:
2561 case ISD::VP_STORE:
2562 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2564 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2566 }
2567 }
2570 default:
2572 case ISD::VP_LOAD:
2574 case ISD::VP_STORE:
2575 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2577 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2579 }
2580 }
2581
2582
2583
2586 }
2587
2588
2590
2591
2593
2595 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD ||
2596 N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE ||
2597 N->getOpcode() == ISD::VP_LOAD || N->getOpcode() == ISD::VP_STORE;
2598 }
2599};
2600
2601
2603public:
2605
2612 }
2613
2616 }
2617
2622
2624 return N->getOpcode() == ISD::VP_LOAD;
2625 }
2627};
2628
2629
2631public:
2633
2638 AM, MemVT, MMO) {
2641 }
2642
2645 }
2646
2652
2654 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD;
2655 }
2657};
2658
2659
2661public:
2663
2670 }
2671
2672
2673
2674
2676
2677
2678
2679
2680
2682
2688
2690 return N->getOpcode() == ISD::VP_STORE;
2691 }
2692};
2693
2694
2696public:
2698
2703 VTs, AM, MemVT, MMO) {
2706 }
2707
2708
2709
2710
2712
2713
2714
2715
2716
2718
2725
2727 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE;
2728 }
2729};
2730
2731
2733public:
2735
2740 : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2743 }
2744
2745
2746
2747
2750 }
2753 }
2754
2755
2756
2759 }
2760
2761
2763
2764
2766
2770 }
2771};
2772
2773
2775public:
2777
2784 }
2785
2788 }
2789
2794
2797 }
2798
2800};
2801
2802
2804public:
2806
2813 }
2814
2815
2816
2817
2819
2820
2821
2822
2823
2825
2830
2833 }
2834};
2835
2836
2837
2838
2840public:
2842
2846 : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2849 }
2850
2851
2854 }
2856 return !cast(getScale())->isOne();
2857 }
2859
2860
2861
2862
2863
2866 }
2869 }
2872 }
2875 }
2878 }
2879
2881 return N->getOpcode() == ISD::VP_GATHER ||
2882 N->getOpcode() == ISD::VP_SCATTER;
2883 }
2884};
2885
2886
2887
2889public:
2891
2895 IndexType) {}
2896
2898 return N->getOpcode() == ISD::VP_GATHER;
2899 }
2900};
2901
2902
2903
2905public:
2907
2911 IndexType) {}
2912
2914
2916 return N->getOpcode() == ISD::VP_SCATTER;
2917 }
2918};
2919
2920
2921
2922
2924public:
2926
2930 : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2933 }
2934
2935
2938 }
2940 return !cast(getScale())->isOne();
2941 }
2943
2944
2945
2946
2947
2952
2956 }
2957};
2958
2959
2960
2962public:
2964
2969 IndexType) {
2971 }
2972
2974
2977 }
2978
2981 }
2982};
2983
2984
2985
2987public:
2989
2994 IndexType) {
2996 }
2997
2998
2999
3000
3002
3004
3007 }
3008};
3009
3011public:
3013
3018 VTs, MemVT, MMO, IndexType) {}
3019
3022 }
3023
3030
3033 }
3034};
3035
3037public:
3039
3042 : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
3044 "Expected FP state access node");
3045 }
3046
3050 }
3051};
3052
3053
3054
3055
3056
3057
3058
3059
3061private:
3063
3065 : SDNode(Opc, Order, DL, VTs) {}
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3082
3083
3084
3085
3086
3087 int NumMemRefs = 0;
3088
3089public:
3091
3093
3094 if (NumMemRefs == 0)
3095 return {};
3096 if (NumMemRefs == 1)
3098
3099
3100 return ArrayRef(cast<MachineMemOperand **>(MemRefs), NumMemRefs);
3101 }
3105
3106
3108 MemRefs = nullptr;
3109 NumMemRefs = 0;
3110 }
3111
3113 return N->isMachineOpcode();
3114 }
3115};
3116
3117
3118
3120 Align Alignment;
3121
3122public:
3124 : SDNode(ISD::AssertAlign, Order, DL, VTs), Alignment(A) {}
3125
3127
3130 }
3131};
3132
3135 unsigned Operand;
3136
3138
3139public:
3145
3147 return Operand == x.Operand;
3148 }
3150
3152 return Node->getOperand(Operand).getNode();
3153 }
3155
3157 ++Operand;
3158 return *this;
3159 }
3162 }
3165 "Cannot compare iterators of two different nodes!");
3166 return Operand - Other.Operand;
3167 }
3168
3172 }
3173
3176};
3177
3181
3183
3186 }
3187
3190 }
3191};
3192
3193
3194
3195
3196
3201
3202
3204
3205namespace ISD {
3206
3207
3209 auto *Ld = dyn_cast(N);
3212 }
3213
3214
3216 auto *Ld = dyn_cast(N);
3218 }
3219
3220
3222 auto *Ld = dyn_cast(N);
3223 return Ld && Ld->getExtensionType() == ISD::EXTLOAD;
3224 }
3225
3226
3228 auto *Ld = dyn_cast(N);
3229 return Ld && Ld->getExtensionType() == ISD::SEXTLOAD;
3230 }
3231
3232
3234 auto *Ld = dyn_cast(N);
3235 return Ld && Ld->getExtensionType() == ISD::ZEXTLOAD;
3236 }
3237
3238
3240 auto *Ld = dyn_cast(N);
3241 return Ld && Ld->getAddressingMode() == ISD::UNINDEXED;
3242 }
3243
3244
3245
3247 auto *St = dyn_cast(N);
3248 return St && !St->isTruncatingStore() &&
3250 }
3251
3252
3254 auto *St = dyn_cast(N);
3255 return St && St->getAddressingMode() == ISD::UNINDEXED;
3256 }
3257
3258
3259
3260
3261 template
3263 std::function<bool(ConstNodeType *)> Match,
3264 bool AllowUndefs = false);
3265
3266
3269 bool AllowUndefs = false) {
3270 return matchUnaryPredicateImpl(Op, Match, AllowUndefs);
3271 }
3272
3273
3274 inline bool
3277 bool AllowUndefs = false) {
3278 return matchUnaryPredicateImpl(Op, Match, AllowUndefs);
3279 }
3280
3281
3282
3283
3284
3288 bool AllowUndefs = false, bool AllowTypeMismatch = false);
3289
3290
3291
3293 unsigned Opc = Op.getOpcode();
3294 return (Op.getResNo() == 1 &&
3297 }
3298
3299}
3300
3301}
3302
3303#endif
static msgpack::DocNode getNode(msgpack::DocNode DN, msgpack::Type Type, MCValue Val)
This file declares a class to represent arbitrary precision floating point values and provide a varie...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
This file implements the BitVector class.
#define LLVM_DECLARE_ENUM_AS_BITMASK(Enum, LargestValue)
LLVM_DECLARE_ENUM_AS_BITMASK can be used to declare an enum type as a bit set, so that bitwise operat...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static std::optional< bool > isBigEndian(const SmallDenseMap< int64_t, int64_t, 8 > &MemOffset2Idx, int64_t LowestIdx)
Given a map from byte offsets in memory to indices in a load/store, determine if that map corresponds...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file defines a hash set that can be used to remove duplication of nodes in a graph.
This file defines the little GraphTraits template class that should be specialized by classes that...
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
#define END_TWO_BYTE_PACK()
#define BEGIN_TWO_BYTE_PACK()
static cl::opt< unsigned > MaxSteps("has-predecessor-max-steps", cl::Hidden, cl::init(8192), cl::desc("DAG combiner limit number of steps when searching DAG " "for predecessor nodes"))
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
DEMANGLE_DUMP_METHOD void dump() const
Class for arbitrary precision integers.
unsigned getSrcAddressSpace() const
AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, unsigned SrcAS, unsigned DestAS)
unsigned getDestAddressSpace() const
static bool classof(const SDNode *N)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An SDNode that records if a register contains a value that is guaranteed to be aligned accordingly.
static bool classof(const SDNode *N)
AssertAlignSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, Align A)
This is an SDNode representing atomic operations.
void setExtensionType(ISD::LoadExtType ETy)
static bool classof(const SDNode *N)
const SDValue & getBasePtr() const
ISD::LoadExtType getExtensionType() const
AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL, EVT MemVT, MachineMemOperand *MMO)
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
bool isCompareAndSwap() const
Returns true if this SDNode represents cmpxchg atomic operation, false otherwise.
const SDValue & getVal() const
MachineBasicBlock * getBasicBlock() const
static bool classof(const SDNode *N)
LLVM Basic Block Representation.
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getTargetFlags() const
const BlockAddress * getBlockAddress() const
The address of a basic block.
A "pseudo-class" with methods for operating on BUILD_VECTORs.
BuildVectorSDNode()=delete
bool getConstantRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits, SmallVectorImpl< APInt > &RawBitElements, BitVector &UndefElements) const
Extract the raw bit data from a build vector of Undef, Constant or ConstantFP node elements.
static void recastRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits, SmallVectorImpl< APInt > &DstBitElements, ArrayRef< APInt > SrcBitElements, BitVector &DstUndefElements, const BitVector &SrcUndefElements)
Recast bit data SrcBitElements to DstEltSizeInBits wide elements.
bool getRepeatedSequence(const APInt &DemandedElts, SmallVectorImpl< SDValue > &Sequence, BitVector *UndefElements=nullptr) const
Find the shortest repeating sequence of values in the build vector.
ConstantFPSDNode * getConstantFPSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant FP or null if this is not a constant FP splat.
std::optional< std::pair< APInt, APInt > > isConstantSequence() const
If this BuildVector is constant and represents the numerical series "<a, a+n, a+2n,...
SDValue getSplatValue(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted value or a null value if this is not a splat.
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector.
ConstantSDNode * getConstantSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant or null if this is not a constant splat.
int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements, uint32_t BitWidth) const
If this is a constant FP splat and the splatted constant FP is an exact power or 2,...
static bool classof(const SDNode *N)
ISD::CondCode get() const
static bool classof(const SDNode *N)
static bool isValueValidForType(EVT VT, const APFloat &Val)
const APFloat & getValueAPF() const
bool isNaN() const
Return true if the value is a NaN.
const ConstantFP * getConstantFPValue() const
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
bool isNegative() const
Return true if the value is negative.
bool isInfinity() const
Return true if the value is an infinity.
static bool classof(const SDNode *N)
bool isZero() const
Return true if the value is positive or negative zero.
ConstantFP - Floating Point Values [float, double].
This is the shared class of boolean and integer constants.
static bool classof(const SDNode *N)
MachineConstantPoolValue * getMachineCPVal() const
bool isMachineConstantPoolEntry() const
const Constant * ConstVal
MachineConstantPoolValue * MachineCPVal
const Constant * getConstVal() const
unsigned getTargetFlags() const
MaybeAlign getMaybeAlignValue() const
bool isMinSignedValue() const
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX)
const ConstantInt * getConstantIntValue() const
bool isMaxSignedValue() const
uint64_t getZExtValue() const
Align getAlignValue() const
const APInt & getAPIntValue() const
int64_t getSExtValue() const
static bool classof(const SDNode *N)
This is an important base class in LLVM.
This class represents an Operation in the Expression.
bool hasTrivialDestructor() const
Check whether this has a trivial destructor.
const char * getSymbol() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
Utility class for floating point operations which can have information about relaxed accuracy require...
bool hasAllowReassoc() const
Test if this operation may be simplified with reassociative transforms.
bool hasNoNaNs() const
Test if this operation's arguments and results are assumed not-NaN.
bool hasAllowReciprocal() const
Test if this operation can use reciprocal multiply instead of division.
bool hasNoSignedZeros() const
Test if this operation can ignore the sign of zero.
bool hasAllowContract() const
Test if this operation can be floating-point contracted (FMA).
bool hasNoInfs() const
Test if this operation's arguments and results are assumed not-infinite.
bool hasApproxFunc() const
Test if this operation allows approximations of math library functions or intrinsics.
static bool classof(const SDNode *N)
FPStateAccessSDNode(unsigned NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
Node - This class is used to maintain the singly linked bucket list in a folding set.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getAddressSpace() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
const GlobalValue * getGlobal() const
This class is used to form a handle around another node that is persistent and is updated across invo...
const SDValue & getValue() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
Base class for LoadSDNode and StoreSDNode.
LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
const SDValue & getOffset() const
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
static bool classof(const SDNode *N)
MCSymbol * getLabel() const
static bool classof(const SDNode *N)
This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate the offet and size that ar...
int64_t getFrameIndex() const
static bool classof(const SDNode *N)
int64_t getOffset() const
This class is used to represent ISD::LOAD nodes.
const SDValue & getBasePtr() const
const SDValue & getOffset() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static bool classof(const SDNode *N)
MCSymbol * getMCSymbol() const
static bool classof(const SDNode *N)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static bool classof(const SDNode *N)
const MDNode * getMD() const
Abstract base class for all machine specific constantpool value subclasses.
A description of a memory reference used in the backend.
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
bool isUnordered() const
Returns true if this memory operation doesn't have any ordering constraints other than normal aliasin...
const MDNode * getRanges() const
Return the range tag for the memory reference.
bool isAtomic() const
Returns true if this operation has an atomic ordering requirement of unordered or higher,...
void refineAlignment(const MachineMemOperand *MMO)
Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
const MachinePointerInfo & getPointerInfo() const
Align getAlign() const
Return the minimum known alignment in bytes of the actual memory reference.
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
Align getBaseAlign() const
Return the minimum known alignment in bytes of the base address, without the offset.
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
An SDNode that represents everything that will be needed to construct a MachineInstr.
ArrayRef< MachineMemOperand * > memoperands() const
bool memoperands_empty() const
void clearMemRefs()
Clear out the memory reference descriptor list.
mmo_iterator memoperands_begin() const
static bool classof(const SDNode *N)
mmo_iterator memoperands_end() const
This class is used to represent an MGATHER node.
static bool classof(const SDNode *N)
MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, ISD::LoadExtType ETy)
const SDValue & getPassThru() const
ISD::LoadExtType getExtensionType() const
This is a base class used to represent MGATHER and MSCATTER nodes.
const SDValue & getIndex() const
bool isIndexScaled() const
const SDValue & getScale() const
static bool classof(const SDNode *N)
MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getBasePtr() const
const SDValue & getMask() const
bool isIndexSigned() const
ISD::MemIndexType getIndexType() const
How is Index applied to BasePtr when computing addresses.
const SDValue & getInc() const
MaskedHistogramSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getScale() const
static bool classof(const SDNode *N)
const SDValue & getMask() const
const SDValue & getIntID() const
const SDValue & getIndex() const
const SDValue & getBasePtr() const
ISD::MemIndexType getIndexType() const
This class is used to represent an MLOAD node.
MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getBasePtr() const
bool isExpandingLoad() const
ISD::LoadExtType getExtensionType() const
const SDValue & getMask() const
const SDValue & getPassThru() const
static bool classof(const SDNode *N)
const SDValue & getOffset() const
This base class is used to represent MLOAD and MSTORE nodes.
const SDValue & getMask() const
MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
static bool classof(const SDNode *N)
const SDValue & getOffset() const
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
This class is used to represent an MSCATTER node.
MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, bool IsTrunc)
const SDValue & getValue() const
static bool classof(const SDNode *N)
bool isTruncatingStore() const
Return true if the op does a truncation before store.
This class is used to represent an MSTORE node.
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getOffset() const
const SDValue & getBasePtr() const
const SDValue & getMask() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
static bool classof(const SDNode *N)
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand.
MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
static bool classof(const SDNode *N)
This is an abstract virtual class for memory operations.
MachineMemOperand * MMO
Memory reference information.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
const MDNode * getRanges() const
Returns the Ranges that describes the dereference.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
Align getOriginalAlign() const
Returns alignment and volatility of the memory access.
int64_t getSrcValueOffset() const
bool isSimple() const
Returns true if the memory operation is neither atomic or volatile.
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
const SDValue & getBasePtr() const
void refineAlignment(const MachineMemOperand *NewMMO)
Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO,...
const MachinePointerInfo & getPointerInfo() const
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
const SDValue & getChain() const
bool isNonTemporal() const
bool isDereferenceable() const
bool isUnordered() const
Returns true if the memory operation doesn't imply any ordering constraints on surrounding memory ope...
bool isAtomic() const
Return true if the memory operation ordering is Unordered or higher.
static bool classof(const SDNode *N)
unsigned getRawSubclassData() const
Return the SubclassData value, without HasDebugValue.
EVT getMemoryVT() const
Return the type of the in-memory value.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
First const * getAddrOfPtr1() const
If the union is set to the first pointer type get an address pointing to it.
This SDNode is used for PSEUDO_PROBE values, which are the function guid and the index of the basic b...
static bool classof(const SDNode *N)
uint32_t getAttributes() const
uint64_t getIndex() const
const uint32_t * getRegMask() const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
Wrapper class representing virtual and physical registers.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
const DebugLoc & getDebugLoc() const
unsigned getIROrder() const
SDLoc(const Instruction *I, int Order)
pointer operator->() const
static SDNodeIterator end(const SDNode *N)
size_t operator-(SDNodeIterator Other) const
SDNodeIterator operator++(int)
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
unsigned getOperand() const
pointer operator*() const
SDNodeIterator & operator++()
bool operator==(const SDNodeIterator &x) const
const SDNode * getNode() const
static SDNodeIterator begin(const SDNode *N)
bool operator!=(const SDNodeIterator &x) const
This class provides iterator support for SDUse operands that use a specific SDNode.
bool operator!=(const use_iterator &x) const
use_iterator & operator=(const use_iterator &)=default
use_iterator & operator++()
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
bool operator==(const use_iterator &x) const
SDUse & operator*() const
Retrieve a pointer to the current user node.
use_iterator(const use_iterator &I)=default
SDUse * operator->() const
use_iterator operator++(int)
std::ptrdiff_t difference_type
user_iterator & operator++()
std::forward_iterator_tag iterator_category
bool operator!=(const user_iterator &x) const
SDNode * operator->() const
bool operator==(const user_iterator &x) const
user_iterator operator++(int)
SDNode * operator*() const
Represents one node in the SelectionDAG.
void setDebugLoc(DebugLoc dl)
Set source location info.
uint32_t getCFIType() const
void setIROrder(unsigned Order)
Set the node ordering.
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
ArrayRef< SDUse > ops() const
char RawSDNodeBits[sizeof(uint16_t)]
const APInt & getAsAPIntVal() const
Helper method returns the APInt value of a ConstantSDNode.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
int getNodeId() const
Return the unique node id.
void dump() const
Dump this node, for debugging.
iterator_range< value_iterator > values() const
iterator_range< use_iterator > uses() const
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
SDNode * getGluedUser() const
If this node has a glue value with a user, return the user (there is at most one).
bool hasOneUse() const
Return true if there is exactly one use of this node.
bool isOnlyUserOf(const SDNode *N) const
Return true if this node is the only use of N.
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
iterator_range< value_op_iterator > op_values() const
unsigned getIROrder() const
Return the node ordering.
LoadSDNodeBitfields LoadSDNodeBits
void dropFlags(unsigned Mask)
static constexpr size_t getMaxNumOperands()
Return the maximum number of operands that a SDNode can hold.
int getCombinerWorklistIndex() const
Get worklist index for DAGCombiner.
value_iterator value_end() const
void setHasDebugValue(bool b)
LSBaseSDNodeBitfields LSBaseSDNodeBits
iterator_range< use_iterator > uses()
MemSDNodeBitfields MemSDNodeBits
bool getHasDebugValue() const
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
SDNodeFlags getFlags() const
void setNodeId(int Id)
Set unique node id.
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
void printrFull(raw_ostream &O, const SelectionDAG *G=nullptr) const
Print a SelectionDAG node and all children down to the leaves.
size_t use_size() const
Return the number of uses of this node.
void intersectFlagsWith(const SDNodeFlags Flags)
Clear any flags in this node that aren't also set in Flags.
void printr(raw_ostream &OS, const SelectionDAG *G=nullptr) const
StoreSDNodeBitfields StoreSDNodeBits
static SDVTList getSDVTList(MVT VT)
TypeSize getValueSizeInBits(unsigned ResNo) const
Returns MVT::getSizeInBits(getValueType(ResNo)).
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist, unsigned int MaxSteps=0, bool TopologicalPrune=false)
Returns true if N is a predecessor of any node in Worklist.
uint64_t getAsZExtVal() const
Helper method returns the zero-extended integer value of a ConstantSDNode.
bool use_empty() const
Return true if there are no uses of this node.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
unsigned getNumOperands() const
Return the number of values used by this operation.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
SDVTList getVTList() const
const SDValue & getOperand(unsigned Num) const
bool isMemIntrinsic() const
Test if this node is a memory intrinsic (with valid pointer information).
void setCombinerWorklistIndex(int Index)
Set worklist index for DAGCombiner.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
static bool areOnlyUsersOf(ArrayRef< const SDNode * > Nodes, const SDNode *N)
Return true if all the users of N are contained in Nodes.
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
const DebugLoc & getDebugLoc() const
Return the source location info.
void printrWithDepth(raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-spec...
const APInt & getConstantOperandAPInt(unsigned Num) const
Helper method returns the APInt of a ConstantSDNode operand.
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
void dumprWithDepth(const SelectionDAG *G=nullptr, unsigned depth=100) const
printrWithDepth to dbgs().
static user_iterator user_end()
bool isPredecessorOf(const SDNode *N) const
Return true if this node is a predecessor of N.
bool hasPredecessor(const SDNode *N) const
Return true if N is a predecessor of this node.
void addUse(SDUse &U)
This method should only be used by the SDUse class.
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
void print_details(raw_ostream &OS, const SelectionDAG *G) const
void setCFIType(uint32_t Type)
bool isUndef() const
Return true if the type of the node type undefined.
void print_types(raw_ostream &OS, const SelectionDAG *G) const
iterator_range< user_iterator > users()
iterator_range< user_iterator > users() const
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
bool isVPOpcode() const
Test if this node is a vector predication operation.
bool hasPoisonGeneratingFlags() const
void setFlags(SDNodeFlags NewFlags)
user_iterator user_begin() const
Provide iteration support to walk over all users of an SDNode.
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
bool isTargetOpcode() const
Test if this node has a target-specific opcode (in the ISD namespace).
op_iterator op_end() const
ConstantSDNodeBitfields ConstantSDNodeBits
value_iterator value_begin() const
op_iterator op_begin() const
static use_iterator use_end()
void DropOperands()
Release the operands and set this node to have zero operands.
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
Create an SDNode.
SDNodeBitfields SDNodeBits
Represents a use of a SDNode.
const SDNode * getUser() const
SDUse & operator=(const SDUse &)=delete
EVT getValueType() const
Convenience function for get().getValueType().
const SDValue & get() const
If implicit conversion to SDValue doesn't work, the get() method returns the SDValue.
SDUse * getNext() const
Get the next SDUse in the use list.
SDNode * getNode() const
Convenience function for get().getNode().
bool operator!=(const SDValue &V) const
Convenience function for get().operator!=.
SDUse(const SDUse &U)=delete
unsigned getResNo() const
Convenience function for get().getResNo().
bool operator==(const SDValue &V) const
Convenience function for get().operator==.
unsigned getOperandNo() const
Return the operand # of this use in its user.
bool operator<(const SDValue &V) const
Convenience function for get().operator<.
SDNode * getUser()
This returns the SDNode that contains this Use.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
bool reachesChainWithoutSideEffects(SDValue Dest, unsigned Depth=2) const
Return true if this operand (which must be a chain) reaches the specified operand without crossing an...
bool operator!=(const SDValue &O) const
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
bool isTargetOpcode() const
bool isMachineOpcode() const
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
const DebugLoc & getDebugLoc() const
SDNode * operator->() const
bool operator==(const SDValue &O) const
const SDValue & getOperand(unsigned i) const
bool use_empty() const
Return true if there are no nodes using value ResNo of Node.
bool operator<(const SDValue &O) const
const APInt & getConstantOperandAPInt(unsigned i) const
uint64_t getScalarValueSizeInBits() const
unsigned getResNo() const
get the index which selects a specific result in the SDNode
uint64_t getConstantOperandVal(unsigned i) const
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
void setNode(SDNode *N)
set the SDNode
unsigned getMachineOpcode() const
unsigned getOpcode() const
unsigned getNumOperands() const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
static bool isSplatMask(const int *Mask, EVT VT)
int getMaskElt(unsigned Idx) const
int getSplatIndex() const
ShuffleVectorSDNode(SDVTList VTs, unsigned Order, const DebugLoc &dl, const int *M)
ArrayRef< int > getMask() const
static void commuteMask(MutableArrayRef< int > Mask)
Change values in a shuffle permute mask assuming the two vector operands have swapped position.
static bool classof(const SDNode *N)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An SDNode that holds an arbitrary LLVM IR Value.
const Value * getValue() const
Return the contained Value.
static bool classof(const SDNode *N)
This class is used to represent ISD::STORE nodes.
const SDValue & getBasePtr() const
const SDValue & getOffset() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
void setTruncatingStore(bool Truncating)
static bool classof(const SDNode *N)
Completely target-dependent object reference.
TargetIndexSDNode(int Idx, SDVTList VTs, int64_t Ofs, unsigned TF)
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getTargetFlags() const
The instances of the Type class are immutable: once they are created, they are never changed.
This base class is used to represent VP_LOAD, VP_STORE, EXPERIMENTAL_VP_STRIDED_LOAD and EXPERIMENTAL...
const SDValue & getMask() const
static bool classof(const SDNode *N)
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
VPBaseLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &DL, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getOffset() const
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
const SDValue & getVectorLength() const
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
const SDValue & getBasePtr() const
This class is used to represent an VP_GATHER node.
VPGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
static bool classof(const SDNode *N)
This is a base class used to represent VP_GATHER and VP_SCATTER nodes.
const SDValue & getScale() const
ISD::MemIndexType getIndexType() const
How is Index applied to BasePtr when computing addresses.
const SDValue & getVectorLength() const
const SDValue & getIndex() const
VPGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getBasePtr() const
bool isIndexScaled() const
bool isIndexSigned() const
static bool classof(const SDNode *N)
const SDValue & getMask() const
This class is used to represent a VP_LOAD node.
const SDValue & getOffset() const
const SDValue & getVectorLength() const
ISD::LoadExtType getExtensionType() const
const SDValue & getMask() const
VPLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool isExpanding, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getBasePtr() const
static bool classof(const SDNode *N)
bool isExpandingLoad() const
This class is used to represent an VP_SCATTER node.
static bool classof(const SDNode *N)
VPScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getValue() const
This class is used to represent a VP_STORE node.
const SDValue & getMask() const
VPStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
static bool classof(const SDNode *N)
const SDValue & getVectorLength() const
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
const SDValue & getOffset() const
bool isTruncatingStore() const
Return true if this is a truncating store.
const SDValue & getBasePtr() const
const SDValue & getValue() const
This class is used to represent an EXPERIMENTAL_VP_STRIDED_LOAD node.
const SDValue & getMask() const
ISD::LoadExtType getExtensionType() const
bool isExpandingLoad() const
const SDValue & getStride() const
const SDValue & getOffset() const
const SDValue & getVectorLength() const
static bool classof(const SDNode *N)
const SDValue & getBasePtr() const
VPStridedLoadSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
This class is used to represent an EXPERIMENTAL_VP_STRIDED_STORE node.
const SDValue & getBasePtr() const
const SDValue & getMask() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if this is a truncating store.
VPStridedStoreSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, ISD::MemIndexedMode AM, bool IsTrunc, bool IsCompressing, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getOffset() const
const SDValue & getVectorLength() const
static bool classof(const SDNode *N)
const SDValue & getStride() const
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
This class is used to represent EVT's, which are used to parameterize some operations.
static bool classof(const SDNode *N)
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
CRTP base class for adapting an iterator to a different type.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isConstantSplatVectorAllOnes(const SDNode *N, bool BuildVectorOnly=false)
Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where all of the elements are ~0 ...
bool isNON_EXTLoad(const SDNode *N)
Returns true if the specified node is a non-extending load.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
@ MDNODE_SDNODE
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR.
@ MLOAD
Masked load and store - consecutive vector load and store operations with additional mask operand tha...
@ ATOMIC_STORE
OUTCHAIN = ATOMIC_STORE(INCHAIN, val, ptr) This corresponds to "store atomic" instruction.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ ATOMIC_CMP_SWAP_WITH_SUCCESS
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
@ SRCVALUE
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
@ EH_LABEL
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
@ ANNOTATION_LABEL
ANNOTATION_LABEL - Represents a mid basic block label used by annotations.
@ TargetIndex
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
@ SSUBO
Same for subtraction.
@ ATOMIC_LOAD
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
@ UNDEF
UNDEF - An undefined node.
@ AssertAlign
AssertAlign - These nodes record if a register contains a value that has a known alignment and the tr...
@ BasicBlock
Various leaf nodes.
@ SADDO
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
@ TargetGlobalAddress
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
@ VECTOR_SHUFFLE
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
@ ATOMIC_CMP_SWAP
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo,...
@ SMULO
Same for multiplication.
@ LIFETIME_START
This corresponds to the llvm.lifetime.
@ MGATHER
Masked gather and scatter - load and store operations for a vector of random addresses with additiona...
@ TargetConstant
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification,...
@ GET_FPENV_MEM
Gets the current floating-point environment.
@ PSEUDO_PROBE
Pseudo probe for AutoFDO, as a place holder in a basic block to improve the sample counts quality.
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
@ ATOMIC_SWAP
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN,...
@ ADDRSPACECAST
ADDRSPACECAST - This operator converts between pointers of different address spaces.
@ EXPERIMENTAL_VECTOR_HISTOGRAM
@ SET_FPENV_MEM
Sets the current floating point environment.
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
bool isOverflowIntrOpRes(SDValue Op)
Returns true if the specified value is the overflow result from one of the overflow intrinsic nodes.
bool isBuildVectorOfConstantSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantSDNode or undef.
bool isNormalStore(const SDNode *N)
Returns true if the specified node is a non-truncating and unindexed store.
bool matchUnaryPredicate(SDValue Op, std::function< bool(ConstantSDNode *)> Match, bool AllowUndefs=false)
Hook for matching ConstantSDNode predicate.
bool isZEXTLoad(const SDNode *N)
Returns true if the specified node is a ZEXTLOAD.
bool matchUnaryFpPredicate(SDValue Op, std::function< bool(ConstantFPSDNode *)> Match, bool AllowUndefs=false)
Hook for matching ConstantFPSDNode predicate.
bool isConstantSplatVectorAllZeros(const SDNode *N, bool BuildVectorOnly=false)
Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where all of the elements are 0 o...
bool isVectorShrinkable(const SDNode *N, unsigned NewEltSize, bool Signed)
Returns true if the specified node is a vector where all elements can be truncated to the specified e...
bool matchUnaryPredicateImpl(SDValue Op, std::function< bool(ConstNodeType *)> Match, bool AllowUndefs=false)
Attempt to match a unary predicate against a scalar/splat constant or every element of a constant BUI...
bool isUNINDEXEDLoad(const SDNode *N)
Returns true if the specified node is an unindexed load.
bool isEXTLoad(const SDNode *N)
Returns true if the specified node is a EXTLOAD.
bool allOperandsUndef(const SDNode *N)
Return true if the node has at least one operand and all operands of the specified node are ISD::UNDE...
bool isFreezeUndef(const SDNode *N)
Return true if the specified node is FREEZE(UNDEF).
MemIndexType
MemIndexType enum - This enum defines how to interpret MGATHER/SCATTER's index parameter when calcula...
bool isBuildVectorAllZeros(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR where all of the elements are 0 or undef.
bool isConstantSplatVector(const SDNode *N, APInt &SplatValue)
Node predicates.
bool matchBinaryPredicate(SDValue LHS, SDValue RHS, std::function< bool(ConstantSDNode *, ConstantSDNode *)> Match, bool AllowUndefs=false, bool AllowTypeMismatch=false)
Attempt to match a binary predicate against a pair of scalar/splat constants or every element of a pa...
bool isUNINDEXEDStore(const SDNode *N)
Returns true if the specified node is an unindexed store.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
bool isBuildVectorOfConstantFPSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantFPSDNode or undef.
bool isSEXTLoad(const SDNode *N)
Returns true if the specified node is a SEXTLOAD.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
bool isBuildVectorAllOnes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR where all of the elements are ~0 or undef.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
bool isVPOpcode(unsigned Opcode)
Whether this is a vector-predicated Opcode.
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
This is an optimization pass for GlobalISel generic memory operations.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
SDValue peekThroughExtractSubvectors(SDValue V)
Return the non-extracted vector source operand of V if it exists.
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
bool isAllOnesOrAllOnesSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant -1 integer or a splatted vector of a constant -1 integer (with...
APInt operator&(APInt a, const APInt &b)
SDValue getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs)
If V is a bitwise not, returns the inverted operand.
SDValue peekThroughBitcasts(SDValue V)
Return the non-bitcasted source operand of V if it exists.
bool isIntOrFPConstant(SDValue V)
Return true if V is either a integer or FP constant.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
bool isNullOrNullSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant 0 integer or a splatted vector of a constant 0 integer (with n...
bool isMinSignedConstant(SDValue V)
Returns true if V is a constant min signed integer value.
ConstantFPSDNode * isConstOrConstSplatFP(SDValue N, bool AllowUndefs=false)
Returns the SDNode if it is a constant splat BuildVector or constant float.
bool isBitwiseNot(SDValue V, bool AllowUndefs=false)
Returns true if V is a bitwise not operation.
void checkForCycles(const SelectionDAG *DAG, bool force=false)
SDValue peekThroughTruncates(SDValue V)
Return the non-truncated source operand of V if it exists.
bool hasSingleElement(ContainerTy &&C)
Returns true if the given container only contains a single element.
SDValue peekThroughOneUseBitcasts(SDValue V)
Return the non-bitcasted and one-use source operand of V if it exists.
bool isOneOrOneSplat(SDValue V, bool AllowUndefs=false)
Return true if the value is a constant 1 integer or a splatted vector of a constant 1 integer (with n...
AtomicOrdering
Atomic ordering for LLVM's memory model.
bool isNullConstantOrUndef(SDValue V)
Returns true if V is a constant integer zero or an UNDEF node.
ConstantSDNode * isConstOrConstSplat(SDValue N, bool AllowUndefs=false, bool AllowTruncation=false)
Returns the SDNode if it is a constant splat BuildVector or constant int.
constexpr unsigned BitWidth
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
bool isOneConstant(SDValue V)
Returns true if V is a constant integer one.
bool isNullFPConstant(SDValue V)
Returns true if V is an FP constant with a value of positive zero.
APInt operator|(APInt a, const APInt &b)
bool isNeutralConstant(unsigned Opc, SDNodeFlags Flags, SDValue V, unsigned OperandNo)
Returns true if V is a neutral element of Opc with Flags.
bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
Implement std::hash so that hash_code can be used in STL containers.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
This struct is a compact representation of a valid (non-zero power of two) alignment.
A suitably aligned and sized character array member which can hold elements of any type.
static SDValue getEmptyKey()
static unsigned getHashValue(const SDValue &Val)
static SDValue getTombstoneKey()
static bool isEqual(const SDValue &LHS, const SDValue &RHS)
An information struct used to provide DenseMap with the various necessary components for a given valu...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
static NodeRef getEntryNode(SDNode *N)
This class contains a discriminated union of information about pointers in memory operands,...
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
These are IR-level optimization flags that may be propagated to SDNodes.
void copyFMF(const FPMathOperator &FPMO)
Propagate the fast-math-flags from an IR FPMathOperator.
void setNoFPExcept(bool b)
void setAllowContract(bool b)
void setNoSignedZeros(bool b)
bool hasNoFPExcept() const
bool operator==(const SDNodeFlags &Other) const
void operator&=(const SDNodeFlags &OtherFlags)
void operator|=(const SDNodeFlags &OtherFlags)
bool hasNoUnsignedWrap() const
void setAllowReassociation(bool b)
void setUnpredictable(bool b)
void setAllowReciprocal(bool b)
bool hasAllowContract() const
bool hasNoSignedZeros() const
bool hasApproximateFuncs() const
bool hasUnpredictable() const
void setApproximateFuncs(bool b)
bool hasNoSignedWrap() const
SDNodeFlags(unsigned Flags=SDNodeFlags::None)
Default constructor turns off all optimization flags.
bool hasAllowReciprocal() const
bool hasAllowReassociation() const
void setNoUnsignedWrap(bool b)
void setNoSignedWrap(bool b)
Iterator for directly iterating over the operand SDValue's.
const SDValue & operator*() const
value_op_iterator(SDUse *U=nullptr)
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
static SimpleType getSimplifiedValue(SDUse &Val)
static SimpleType getSimplifiedValue(SDValue &Val)
static SimpleType getSimplifiedValue(const SDValue &Val)
Define a template that can be specialized by smart pointers to reflect the fact that they are automat...