LLVM: include/llvm/IR/InstrTypes.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_IR_INSTRTYPES_H
16#define LLVM_IR_INSTRTYPES_H
17
34#include
35#include
36#include
37#include
38#include
39#include
40#include
41#include
42
43namespace llvm {
44
49
51typedef unsigned ID;
52}
53
54
55
56
57
60
61protected:
64 : Instruction(Ty, iType, AllocMarker, InsertBefore) {
66 }
67
68public:
69
70 void *operator new(size_t S) { return User::operator new(S, AllocMarker); }
71 void operator delete(void *Ptr) { User::operator delete(Ptr); }
72
73
75
76
78 return I->isUnaryOp() || I->getOpcode() == Instruction::Alloca ||
79 I->getOpcode() == Instruction::Load ||
80 I->getOpcode() == Instruction::VAArg ||
81 I->getOpcode() == Instruction::ExtractValue ||
82 I->getOpcode() == Instruction::Freeze ||
83 (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd);
84 }
88};
89
90template <>
94
96
97
98
99
100
102 void AssertOK();
103
104protected:
107
108
110
112
113public:
114
115
116
117
118
122
123
124
125
126#define HANDLE_UNARY_INST(N, OPC, CLASS) \
127 static UnaryOperator *Create##OPC(Value *V, const Twine &Name = "") { \
128 return Create(Instruction::OPC, V, Name); \
129 }
130#include "llvm/IR/Instruction.def"
131#define HANDLE_UNARY_INST(N, OPC, CLASS) \
132 static UnaryOperator *Create##OPC(Value *V, const Twine &Name, \
133 InsertPosition InsertBefore = nullptr) { \
134 return Create(Instruction::OPC, V, Name, InsertBefore); \
135 }
136#include "llvm/IR/Instruction.def"
137
138 static UnaryOperator *
140 const Twine &Name = "",
144 return UO;
145 }
146
148 const Twine &Name = "",
151 InsertBefore);
152 }
153
157
158
160 return I->isUnaryOp();
161 }
165};
166
167
168
169
170
173
174 void AssertOK();
175
176protected:
179
180
182
184
185public:
186
187 void *operator new(size_t S) { return User::operator new(S, AllocMarker); }
188 void operator delete(void *Ptr) { User::operator delete(Ptr); }
189
190
192
193
194
195
196
197
201
202
203
204
205#define HANDLE_BINARY_INST(N, OPC, CLASS) \
206 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
207 const Twine &Name = "") { \
208 return Create(Instruction::OPC, V1, V2, Name); \
209 }
210#include "llvm/IR/Instruction.def"
211#define HANDLE_BINARY_INST(N, OPC, CLASS) \
212 static BinaryOperator *Create##OPC(Value *V1, Value *V2, const Twine &Name, \
213 InsertPosition InsertBefore) { \
214 return Create(Instruction::OPC, V1, V2, Name, InsertBefore); \
215 }
216#include "llvm/IR/Instruction.def"
217
220 const Twine &Name = "",
224 return BO;
225 }
226
229 const Twine &Name = "",
233 return BO;
234 }
235
237 const Twine &Name = "") {
238 return CreateWithFMF(Instruction::FAdd, V1, V2, FMF, Name);
239 }
241 const Twine &Name = "") {
242 return CreateWithFMF(Instruction::FSub, V1, V2, FMF, Name);
243 }
245 const Twine &Name = "") {
246 return CreateWithFMF(Instruction::FMul, V1, V2, FMF, Name);
247 }
249 const Twine &Name = "") {
250 return CreateWithFMF(Instruction::FDiv, V1, V2, FMF, Name);
251 }
252
255 const Twine &Name = "") {
257 }
260 const Twine &Name = "") {
262 }
265 const Twine &Name = "") {
267 }
270 const Twine &Name = "") {
272 }
275 const Twine &Name = "") {
277 }
278
280 const Twine &Name = "") {
283 return BO;
284 }
285
287 const Twine &Name,
291 return BO;
292 }
293
295 const Twine &Name = "") {
298 return BO;
299 }
300
302 const Twine &Name,
306 return BO;
307 }
308
310 const Twine &Name = "") {
313 return BO;
314 }
315
317 const Twine &Name,
321 return BO;
322 }
323
329
330#define DEFINE_HELPERS(OPC, NUWNSWEXACT) \
331 static BinaryOperator *Create##NUWNSWEXACT##OPC(Value *V1, Value *V2, \
332 const Twine &Name = "") { \
333 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name); \
334 } \
335 static BinaryOperator *Create##NUWNSWEXACT##OPC( \
336 Value *V1, Value *V2, const Twine &Name, \
337 InsertPosition InsertBefore = nullptr) { \
338 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name, InsertBefore); \
339 }
340
349
354
356
357#undef DEFINE_HELPERS
358
359
360
361
362
363
365 CreateNeg(Value *Op, const Twine &Name = "",
366 InsertPosition InsertBefore = nullptr);
369 InsertPosition InsertBefore = nullptr);
371 CreateNot(Value *Op, const Twine &Name = "",
372 InsertPosition InsertBefore = nullptr);
373
377
378
379
380
381
382
384
385
387 return I->isBinaryOp();
388 }
392};
393
394template <>
398
400
401
402
403
405public:
407
412
414
416 return I->getOpcode() == Instruction::Or;
417 }
418
422};
423
437
438
439
440
441
442
443
444
445
446
447
449protected:
450
456
457public:
458
459
460
461
462
463
466 Value *S,
467 Type *Ty,
468 const Twine &Name = "",
469 InsertPosition InsertBefore = nullptr
470 );
471
472
474 Value *S,
475 Type *Ty,
476 const Twine &Name = "",
477 InsertPosition InsertBefore = nullptr
478 );
479
480
482 Value *S,
483 Type *Ty,
484 const Twine &Name = "",
485 InsertPosition InsertBefore = nullptr
486 );
487
488
490 Value *S,
491 Type *Ty,
492 const Twine &Name = "",
493 InsertPosition InsertBefore = nullptr
494 );
495
496
498 Value *S,
499 Type *Ty,
500 const Twine &Name = "",
501 InsertPosition InsertBefore = nullptr
502 );
503
504
505
506
507
508
509
511 Value *S,
512 Type *Ty,
513 const Twine &Name = "",
514 InsertPosition InsertBefore = nullptr
515 );
516
517
519 Value *S,
520 Type *Ty,
521 bool isSigned,
522 const Twine &Name = "",
523 InsertPosition InsertBefore = nullptr
524 );
525
526
528 Value *S,
529 Type *Ty,
530 const Twine &Name = "",
531 InsertPosition InsertBefore = nullptr
532 );
533
534
536 Value *S,
537 Type *Ty,
538 const Twine &Name = "",
539 InsertPosition InsertBefore = nullptr
540 );
541
542
544 isBitCastable(Type *SrcTy,
545 Type *DestTy
546 );
547
548
549
550
551
552
554 Type *SrcTy,
555 Type *DestTy,
557
558
559
560
563 bool SrcIsSigned,
564 Type *Ty,
565 bool DstIsSigned
566 );
567
568
569
570
571
572
574
575
576
577
578
579
580
581
584 Type *SrcTy,
585 Type *DstTy,
586 const DataLayout &DL
587 );
588
589
590
591
593
594
595
596
597
598
599
603 Type *SrcTy,
604 Type *MidTy,
605 Type *DstTy,
606 const DataLayout *DL
607 );
608
609
613
614
616
618
619
620
621
622
624 Type *DstTy);
628
629
631 return I->isCast();
632 }
636};
637
638
640public:
642
644 switch (I->getOpcode()) {
645 case Instruction::ZExt:
646 case Instruction::UIToFP:
647 return true;
648 default:
649 return false;
650 }
651 }
652
656};
657
658
659
660
661
662
663
666
667public:
668
669
670
671
672
673
674
675
677
678 FCMP_FALSE = 0,
710 };
713
714
720
721
727
728protected:
733
734public:
735
736 void *operator new(size_t S) { return User::operator new(S, AllocMarker); }
737 void operator delete(void *Ptr) { User::operator delete(Ptr); }
738
739
740
741
742
743
747
748
749
750
751
752
753
758
759
763
764
766
767
769
772 "FIRST_FCMP_PREDICATE is required to be 0");
774 }
775
779
781
784
785
786
787
788
792
793
794
795
799
803
804
805
806
810
814
815
816
817
818
820
821
822
823
824
825
826
830
831
832
833
835
836
837
838
840
841
842
844
845
846
847
849
850
851
855
856
857
861
862
863
864
865
866
868
869
870
874
875
876
877
878
879
881
882
883
884
886
887
888
889
890
891
892
896
897
899
900
901
902
904
905
906
908
909
910
911
913
914
916
917
918
919
921
922
924
925
927
928
929
933
934
935
939
940
941
945
946
947
951
952
953
955
956
957
959
960
962
963
965
966
968
969
971
972
974 return I->getOpcode() == Instruction::ICmp ||
975 I->getOpcode() == Instruction::FCmp;
976 }
980
981
985 vt->getElementCount());
986 }
988 }
989
990private:
991
992
993 void setValueSubclassData(unsigned short D) {
995 }
996};
997
998
999template <>
1002
1004
1006
1007
1008
1011
1015
1016
1017
1020 if (A == Attribute::ReadOnly)
1021 return Inputs[Idx]->getType()->isPointerTy();
1022
1023
1024 return false;
1025 }
1026
1027
1029 return Tag->getKey();
1030 }
1031
1032
1033
1034
1035
1036
1038 return Tag->getValue();
1039 }
1040
1041
1045
1046
1050
1051
1055
1056private:
1057
1059};
1060
1061
1062
1063
1064
1065
1066
1068 std::string Tag;
1069 std::vector Inputs;
1070
1071public:
1075 : Tag(std::move(Tag)), Inputs(Inputs) {}
1076
1081
1083
1084 using input_iterator = typename std::vector::const_iterator;
1085
1089
1091};
1092
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1115protected:
1116
1121 static_assert(
1123 "Bitfields must be contiguous");
1124
1125
1127
1130
1131 template <class... ArgsTy>
1134
1136
1138
1141 case Instruction::Call:
1142 return 0;
1143 case Instruction::Invoke:
1144 return 2;
1145 case Instruction::CallBr:
1147 }
1149 }
1150
1151
1152
1154
1155public:
1157
1158
1159
1160
1161
1162
1163
1167
1168
1169
1170
1171
1172
1175
1176
1180
1181
1185
1186
1189 return Bundle->Inputs[0].get();
1190 }
1191 return nullptr;
1192 }
1193
1195 return I->getOpcode() == Instruction::Call ||
1196 I->getOpcode() == Instruction::Invoke ||
1197 I->getOpcode() == Instruction::CallBr;
1198 }
1202
1204
1207 this->FTy = FTy;
1208 }
1209
1211
1212
1213
1214
1215
1216
1241
1243 assert(this == U->getUser() &&
1244 "Only valid to query with a use of this instruction!");
1246 }
1250
1251
1252
1256
1257
1258
1263
1264
1269
1270
1279
1280
1289
1294
1299
1300
1309
1311 assert(this == U->getUser() &&
1312 "Only valid to query with a use of this instruction!");
1314 }
1318
1319
1320
1325
1326
1327
1331
1332
1333
1337
1339
1342
1343
1344
1345
1349 return F;
1350 return nullptr;
1351 }
1352
1353
1355
1356
1358 return isCallee(&UI.getUse());
1359 }
1360
1361
1363
1364
1369
1370
1371
1373
1374
1376
1377
1378
1379
1381
1383
1384
1388
1389
1393
1394
1395
1397 this->FTy = FTy;
1398
1399
1402 }
1403
1407
1411
1412
1414
1415
1416
1417
1418
1419
1420
1421
1423
1424
1426
1427
1431
1432
1436
1437
1438
1439
1440
1442 if (this == Other)
1443 return true;
1445 AttributeList ALOther = Other->getAttributes();
1446 auto Intersected = AL.intersectWith(getContext(), ALOther);
1447 if (!Intersected)
1448 return false;
1450 return true;
1451 }
1452
1453
1454
1455
1457 assert(Kind != Attribute::NoBuiltin &&
1458 "Use CallBase::isNoBuiltin() to check for Attribute::NoBuiltin");
1459 return hasFnAttrImpl(Kind);
1460 }
1461
1462
1463
1464
1466
1467
1468
1472
1473
1477
1478
1482
1483
1487
1488
1492
1493
1497
1498
1502
1503
1508
1509
1514
1515
1520
1521
1525
1526
1530
1531
1535
1536
1540
1541
1545
1546
1550
1551
1555
1556
1561
1562
1567
1568
1572
1573
1577
1578
1582
1583
1587
1588
1590 return hasRetAttrImpl(Kind);
1591 }
1592
1594
1595
1600
1601
1603 return F->getRetAttribute(Kind);
1605 }
1606
1607
1609
1610
1611
1612
1613
1614
1615
1617 bool AllowUndefOrPoison) const;
1618
1619
1623
1624
1628
1629
1633 return Attr;
1634 return getFnAttrOnCalledFunction(Kind);
1635 }
1636
1637
1640 if (A.isValid())
1641 return A;
1642 return getFnAttrOnCalledFunction(Kind);
1643 }
1644
1645
1649 if (A.isValid())
1650 return A;
1651 return getParamAttrOnCalledFunction(ArgNo, Kind);
1652 }
1653
1654
1658 if (A.isValid())
1659 return A;
1660 return getParamAttrOnCalledFunction(ArgNo, Kind);
1661 }
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1675
1677 "Data operand index out of bounds!");
1678
1679
1680
1681
1682
1685
1687 "Must be either a call argument or an operand bundle!");
1689 }
1690
1691
1693
1694
1695
1696
1700
1701
1702
1703
1705
1706
1710
1711
1713 return paramHasAttr(ArgNo, Attribute::InAlloca);
1714 }
1715
1716
1717
1723
1724
1725
1726
1728 return paramHasAttr(ArgNo, Attribute::NoUndef) ||
1729
1730 paramHasAttr(ArgNo, Attribute::Dereferenceable) ||
1731
1732 paramHasAttr(ArgNo, Attribute::DereferenceableOrNull);
1733 }
1734
1735
1736
1740
1741
1742
1746
1747
1748
1750
1751
1753 return true;
1754
1757 }
1758
1759
1760
1765
1766
1768 if (auto Align = Attrs.getRetAlignment())
1771 return F->getAttributes().getRetAlignment();
1772 return std::nullopt;
1773 }
1774
1775
1777 return Attrs.getParamAlignment(ArgNo);
1778 }
1779
1781 return Attrs.getParamStackAlignment(ArgNo);
1782 }
1783
1784
1786 if (auto *Ty = Attrs.getParamByRefType(ArgNo))
1787 return Ty;
1789 return F->getAttributes().getParamByRefType(ArgNo);
1790 return nullptr;
1791 }
1792
1793
1795 if (auto *Ty = Attrs.getParamByValType(ArgNo))
1796 return Ty;
1798 return F->getAttributes().getParamByValType(ArgNo);
1799 return nullptr;
1800 }
1801
1802
1804 if (auto *Ty = Attrs.getParamPreallocatedType(ArgNo))
1805 return Ty;
1807 return F->getAttributes().getParamPreallocatedType(ArgNo);
1808 return nullptr;
1809 }
1810
1811
1813 if (auto *Ty = Attrs.getParamInAllocaType(ArgNo))
1814 return Ty;
1816 return F->getAttributes().getParamInAllocaType(ArgNo);
1817 return nullptr;
1818 }
1819
1820
1822 if (auto *Ty = Attrs.getParamStructRetType(ArgNo))
1823 return Ty;
1825 return F->getAttributes().getParamStructRetType(ArgNo);
1826 return nullptr;
1827 }
1828
1829
1830
1831
1833 return Attrs.getParamElementType(ArgNo);
1834 }
1835
1836
1837
1839 uint64_t Bytes = Attrs.getRetDereferenceableBytes();
1841 Bytes = std::max(Bytes, F->getAttributes().getRetDereferenceableBytes());
1842 return Bytes;
1843 }
1844
1845
1846
1848 return Attrs.getParamDereferenceableBytes(i);
1849 }
1850
1851
1852
1854 uint64_t Bytes = Attrs.getRetDereferenceableOrNullBytes();
1856 Bytes = std::max(Bytes,
1857 F->getAttributes().getRetDereferenceableOrNullBytes());
1858 }
1859
1860 return Bytes;
1861 }
1862
1863
1864
1866 return Attrs.getParamDereferenceableOrNullBytes(i);
1867 }
1868
1869
1870
1872
1873
1874
1876
1877
1878
1880
1881
1882
1883
1885
1886
1888 return Attrs.hasRetAttr(Attribute::NoAlias);
1889 }
1890
1891
1892
1896
1897
1898
1900
1901
1902
1904 return hasFnAttrImpl(Attribute::NoBuiltin) &&
1905 !hasFnAttrImpl(Attribute::Builtin);
1906 }
1907
1908
1910
1911
1914
1917
1918
1921
1922
1925
1926
1929
1930
1931
1934
1935
1936
1939
1940
1941
1944
1945
1948
1949
1951
1952
1955
1956
1959
1960
1963
1964
1968
1969
1970
1973 return false;
1974
1975
1976 return paramHasAttr(0, Attribute::StructRet);
1977 }
1978
1979
1981 return Attrs.hasAttrSomewhere(Attribute::ByVal);
1982 }
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1997
1998
2000
2001
2006
2007
2012
2013
2018
2019
2020
2025
2026
2028 assert(this == U->getUser() &&
2029 "Only valid to query with a use of this instruction!");
2031 }
2035
2036
2037
2040 return 0;
2041
2044
2045 assert(Begin <= End && "Should be!");
2046 return End - Begin;
2047 }
2048
2049
2054
2055
2056
2058 unsigned Count = 0;
2062
2064 }
2065
2066
2067
2069 unsigned Count = 0;
2073
2075 }
2076
2077
2078
2079
2080
2083
2086 if (U.getTagName() == Name)
2087 return U;
2088 }
2089
2090 return std::nullopt;
2091 }
2092
2093
2094
2095
2096
2099
2102 if (U.getTagID() == ID)
2103 return U;
2104 }
2105
2106 return std::nullopt;
2107 }
2108
2109
2110
2111
2112
2113
2114
2115
2118
2119
2120
2121
2122
2126
2127
2128
2130
2131
2132
2134
2135
2136
2140 return OBU.operandHasAttr(OpIdx - BOI.Begin, A);
2141 }
2142
2143
2144
2145
2148 return false;
2149
2151 Other.bundle_op_info_begin());
2152 }
2153
2154
2155
2160 return true;
2161 }
2162 return false;
2163 }
2164
2165
2166
2168
2169
2171
2172
2173
2175
2176
2177
2179
2183 };
2184
2185
2186
2189 const auto *begin = op_begin();
2192 }
2193
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2245 return nullptr;
2246
2249 }
2250
2251
2252
2254 auto *NonConstThis = const_cast<CallBase *>(this);
2255 return NonConstThis->bundle_op_info_begin();
2256 }
2257
2258
2259
2262 return nullptr;
2263
2266 }
2267
2268
2269
2271 auto *NonConstThis = const_cast<CallBase *>(this);
2272 return NonConstThis->bundle_op_info_end();
2273 }
2274
2275
2279
2280
2284
2285
2286
2287
2288
2289
2290
2293
2294
2298
2299public:
2300
2301
2302
2303
2308
2309protected:
2310
2312 unsigned Total = 0;
2313 for (const auto &B : Bundles)
2316 }
2317
2318
2319
2320
2321private:
2324
2325 template bool hasFnAttrImpl(AttrKind Kind) const {
2326 if (Attrs.hasFnAttr(Kind))
2327 return true;
2328
2329 return hasFnAttrOnCalledFunction(Kind);
2330 }
2331 template Attribute getFnAttrOnCalledFunction(AK Kind) const;
2332 template
2333 Attribute getParamAttrOnCalledFunction(unsigned ArgNo, AK Kind) const;
2334
2335
2336
2337 template bool hasRetAttrImpl(AttrKind Kind) const {
2338 if (Attrs.hasRetAttr(Kind))
2339 return true;
2340
2341
2343 return F->getAttributes().hasRetAttr(Kind);
2344 return false;
2345 }
2346};
2347
2348template <>
2350
2352
2353
2354
2355
2357private:
2359
2364
2366
2367protected:
2368
2372
2374
2375public:
2376
2378
2379
2380
2382
2383
2384
2385
2386
2387
2388
2392 Op<-1>() = ParentPad;
2393 }
2394
2395
2396
2399
2400
2402
2403
2407
2408
2413};
2414
2415template <>
2418
2420
2421}
2422
2423#endif
OperandBundleDefT< Value * > OperandBundleDef
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static bool isSigned(unsigned int Opcode)
#define DEFINE_HELPERS(OPC, NUWNSWEXACT)
Definition InstrTypes.h:330
MachineInstr unsigned OpIdx
#define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS)
Macro for generating out-of-class operand accessor definitions.
Provides some synthesis utilities to produce sequences of values.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class stores enough information to efficiently remove some attributes from an existing AttrBuild...
This class holds the attributes for a particular argument, parameter, function, or return value.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results,...
bool isValid() const
Return true if the attribute is any kind of attribute.
Definition InstrTypes.h:171
static BinaryOperator * CreateFAddFMF(Value *V1, Value *V2, FastMathFlags FMF, const Twine &Name="")
Definition InstrTypes.h:236
static LLVM_ABI BinaryOperator * CreateNeg(Value *Op, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and...
static BinaryOperator * CreateFDivFMF(Value *V1, Value *V2, Instruction *FMFSource, const Twine &Name="")
Definition InstrTypes.h:268
BinaryOps getOpcode() const
Definition InstrTypes.h:374
static BinaryOperator * CreateNSW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
Definition InstrTypes.h:279
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static bool classof(const Value *V)
Definition InstrTypes.h:389
static BinaryOperator * CreateFRemFMF(Value *V1, Value *V2, Instruction *FMFSource, const Twine &Name="")
Definition InstrTypes.h:273
static BinaryOperator * CreateWithFMF(BinaryOps Opc, Value *V1, Value *V2, FastMathFlags FMF, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Definition InstrTypes.h:227
static BinaryOperator * CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
Definition InstrTypes.h:309
static BinaryOperator * CreateFMulFMF(Value *V1, Value *V2, Instruction *FMFSource, const Twine &Name="")
Definition InstrTypes.h:263
LLVM_ABI bool swapOperands()
Exchange the two operands to this instruction.
static BinaryOperator * CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, InsertPosition InsertBefore)
Definition InstrTypes.h:316
static LLVM_ABI BinaryOperator * CreateNot(Value *Op, const Twine &Name="", InsertPosition InsertBefore=nullptr)
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition InstrTypes.h:181
static BinaryOperator * CreateFSubFMF(Value *V1, Value *V2, Instruction *FMFSource, const Twine &Name="")
Definition InstrTypes.h:258
static LLVM_ABI BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), InsertPosition InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
Definition InstrTypes.h:294
static BinaryOperator * CreateFAddFMF(Value *V1, Value *V2, Instruction *FMFSource, const Twine &Name="")
Definition InstrTypes.h:253
static BinaryOperator * CreateFMulFMF(Value *V1, Value *V2, FastMathFlags FMF, const Twine &Name="")
Definition InstrTypes.h:244
static BinaryOperator * CreateFDivFMF(Value *V1, Value *V2, FastMathFlags FMF, const Twine &Name="")
Definition InstrTypes.h:248
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, InsertPosition InsertBefore)
Definition InstrTypes.h:301
static BinaryOperator * CreateFSubFMF(Value *V1, Value *V2, FastMathFlags FMF, const Twine &Name="")
Definition InstrTypes.h:240
static BinaryOperator * CreateDisjoint(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
Definition InstrTypes.h:424
static BinaryOperator * CreateWithCopiedFlags(BinaryOps Opc, Value *V1, Value *V2, Value *CopyO, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Definition InstrTypes.h:219
LLVM_ABI BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty, const Twine &Name, InsertPosition InsertBefore)
static LLVM_ABI BinaryOperator * CreateNSWNeg(Value *Op, const Twine &Name="", InsertPosition InsertBefore=nullptr)
LLVM_ABI BinaryOperator * cloneImpl() const
static BinaryOperator * CreateNSW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, InsertPosition InsertBefore)
Definition InstrTypes.h:286
static bool classof(const Instruction *I)
Definition InstrTypes.h:386
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition InstrTypes.h:1114
MaybeAlign getParamStackAlign(unsigned ArgNo) const
Definition InstrTypes.h:1780
void setCalledFunction(FunctionType *FTy, Value *Fn)
Sets the function called, including updating to the specified function type.
Definition InstrTypes.h:1396
LLVM_ABI FPClassTest getParamNoFPClass(unsigned i) const
Extract a test mask for disallowed floating-point value classes for the parameter.
bool isInlineAsm() const
Check if this call is an inline asm statement.
Definition InstrTypes.h:1413
void addFnAttr(Attribute Attr)
Adds the attribute to the function.
Definition InstrTypes.h:1484
bool hasDescriptor() const
Definition InstrTypes.h:1137
LLVM_ABI BundleOpInfo & getBundleOpInfoForOperand(unsigned OpIdx)
Return the BundleOpInfo for the operand at index OpIdx.
Attribute getRetAttr(Attribute::AttrKind Kind) const
Return the attribute for the given attribute kind for the return value.
Definition InstrTypes.h:1596
void setCallingConv(CallingConv::ID CC)
Definition InstrTypes.h:1408
void setDoesNotReturn()
Definition InstrTypes.h:1947
LLVM_ABI FPClassTest getRetNoFPClass() const
Extract a test mask for disallowed floating-point value classes for the return value.
bool cannotMerge() const
Determine if the call cannot be tail merged.
Definition InstrTypes.h:1961
unsigned getBundleOperandsEndIndex() const
Return the index of the last bundle operand in the Use array.
Definition InstrTypes.h:2008
bundle_op_iterator bundle_op_info_begin()
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition InstrTypes.h:2243
LLVM_ABI bool paramHasNonNullAttr(unsigned ArgNo, bool AllowUndefOrPoison) const
Return true if this argument has the nonnull attribute on either the CallBase instruction or the call...
LLVM_ABI MemoryEffects getMemoryEffects() const
void setDoesNotThrow()
Definition InstrTypes.h:1954
void addRangeRetAttr(const ConstantRange &CR)
adds the range attribute to the list of attributes.
Definition InstrTypes.h:1584
bool arg_empty() const
Definition InstrTypes.h:1287
void addFnAttr(Attribute::AttrKind Kind)
Adds the attribute to the function.
Definition InstrTypes.h:1479
bool hasInAllocaArgument() const
Determine if there are is an inalloca argument.
Definition InstrTypes.h:1737
void removeParamAttrs(unsigned ArgNo, const AttributeMask &AttrsToRemove)
Removes the attributes from the given argument.
Definition InstrTypes.h:1569
bool hasByValArgument() const
Determine if any call argument is an aggregate passed by value.
Definition InstrTypes.h:1980
LLVM_ABI bool doesNotAccessMemory() const
Determine if the call does not access memory.
MaybeAlign getRetAlign() const
Extract the alignment of the return value.
Definition InstrTypes.h:1767
LLVM_ABI void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
Type * getParamByRefType(unsigned ArgNo) const
Extract the byref type for a call or parameter.
Definition InstrTypes.h:1785
LLVM_ABI void setOnlyAccessesArgMemory()
iterator_range< const_bundle_op_iterator > bundle_op_infos() const
Return the range [bundle_op_info_begin, bundle_op_info_end).
Definition InstrTypes.h:2281
OperandBundleUse getOperandBundleAt(unsigned Index) const
Return the operand bundle at a specific index.
Definition InstrTypes.h:2050
OperandBundleUse operandBundleFromBundleOpInfo(const BundleOpInfo &BOI) const
Simple helper function to map a BundleOpInfo to an OperandBundleUse.
Definition InstrTypes.h:2188
bool isPassingUndefUB(unsigned ArgNo) const
Determine whether passing undef to this argument is undefined behavior.
Definition InstrTypes.h:1727
bool hasArgument(const Value *V) const
Returns true if this CallSite passes the given Value* as an argument to the called function.
Definition InstrTypes.h:1334
Type * getParamPreallocatedType(unsigned ArgNo) const
Extract the preallocated type for a call or parameter.
Definition InstrTypes.h:1803
LLVM_ABI void setOnlyAccessesInaccessibleMemOrArgMem()
bool data_operands_empty() const
Definition InstrTypes.h:1235
bool isNoBuiltin() const
Return true if the call should not be treated as a call to a builtin.
Definition InstrTypes.h:1903
bool isOperandBundleOfType(uint32_t ID, unsigned Idx) const
Return true if the operand at index Idx is a bundle operand that has tag ID ID.
Definition InstrTypes.h:2021
void addAttributeAtIndex(unsigned i, Attribute Attr)
adds the attribute to the list of attributes.
Definition InstrTypes.h:1474
Bitfield::Element< CallingConv::ID, CallInstReservedField::NextBit, 10, CallingConv::MaxID > CallingConvField
Definition InstrTypes.h:1118
unsigned getDataOperandNo(const Use *U) const
Given a use for a data operand, get the data operand number that corresponds to it.
Definition InstrTypes.h:1259
Bitfield::Element< unsigned, 0, 2 > CallInstReservedField
Definition InstrTypes.h:1117
std::optional< OperandBundleUse > getOperandBundle(StringRef Name) const
Return an operand bundle by name, if present.
Definition InstrTypes.h:2081
bool doesNotCapture(unsigned OpNo) const
Determine whether this data operand is not captured.
Definition InstrTypes.h:1697
Type * getParamStructRetType(unsigned ArgNo) const
Extract the sret type for a call or parameter.
Definition InstrTypes.h:1821
Attribute getParamAttr(unsigned ArgNo, StringRef Kind) const
Get the attribute of a given kind from a given arg.
Definition InstrTypes.h:1655
void removeParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Removes the attribute from the given argument.
Definition InstrTypes.h:1557
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
Definition InstrTypes.h:1346
Type * getParamInAllocaType(unsigned ArgNo) const
Extract the inalloca type for a call or parameter.
Definition InstrTypes.h:1812
bool doesNotAccessMemory(unsigned OpNo) const
Definition InstrTypes.h:1743
void removeRetAttrs(const AttributeMask &AttrsToRemove)
Removes the attributes from the return value.
Definition InstrTypes.h:1552
LLVM_ABI void setDoesNotAccessMemory()
bool isInAllocaArgument(unsigned ArgNo) const
Determine whether this argument is passed in an alloca.
Definition InstrTypes.h:1712
Use & getArgOperandUse(unsigned i)
Definition InstrTypes.h:1305
bool hasFnAttr(Attribute::AttrKind Kind) const
Determine whether this call has the given attribute.
Definition InstrTypes.h:1456
bool isStrictFP() const
Determine if the call requires strict floating point semantics.
Definition InstrTypes.h:1909
User::op_iterator data_operands_begin()
data_operands_begin/data_operands_end - Return iterators iterating over the call / invoke argument li...
Definition InstrTypes.h:1217
bool cannotDuplicate() const
Determine if the invoke cannot be duplicated.
Definition InstrTypes.h:1957
AttributeSet getParamAttributes(unsigned ArgNo) const
Return the param attributes for this call.
Definition InstrTypes.h:1433
bool hasRetAttr(Attribute::AttrKind Kind) const
Determine whether the return value has the given attribute.
Definition InstrTypes.h:1589
User::const_op_iterator data_operands_end() const
Definition InstrTypes.h:1226
LLVM_ABI bool onlyAccessesInaccessibleMemory() const
Determine if the function may only access memory that is inaccessible from the IR.
unsigned getNumOperandBundles() const
Return the number of operand bundles associated with this User.
Definition InstrTypes.h:1994
uint64_t getParamDereferenceableBytes(unsigned i) const
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
Definition InstrTypes.h:1847
void removeAttributeAtIndex(unsigned i, StringRef Kind)
removes the attribute from the list of attributes.
Definition InstrTypes.h:1527
unsigned getDataOperandNo(Value::const_user_iterator UI) const
Given a value use iterator, return the data operand corresponding to it.
Definition InstrTypes.h:1253
CallingConv::ID getCallingConv() const
Definition InstrTypes.h:1404
bundle_op_iterator bundle_op_info_end()
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition InstrTypes.h:2260
LLVM_ABI unsigned getNumSubclassExtraOperandsDynamic() const
Get the number of extra operands for instructions that don't have a fixed number of extra operands.
void addParamAttr(unsigned ArgNo, Attribute Attr)
Adds the attribute to the indicated argument.
Definition InstrTypes.h:1510
BundleOpInfo * bundle_op_iterator
Definition InstrTypes.h:2194
unsigned getNumSubclassExtraOperands() const
Definition InstrTypes.h:1139
bool doesNoCfCheck() const
Determine if the call should not perform indirect branch tracking.
Definition InstrTypes.h:1950
bool hasFnAttr(StringRef Kind) const
Determine whether this call has the given attribute.
Definition InstrTypes.h:1465
LLVM_ABI bool paramHasAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Determine whether the argument or parameter has the given attribute.
bool hasIdenticalOperandBundleSchema(const CallBase &Other) const
Return true if Other has the same sequence of operand bundle tags with the same number of operands on...
Definition InstrTypes.h:2146
User::const_op_iterator arg_begin() const
Definition InstrTypes.h:1266
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
Definition InstrTypes.h:1265
LLVM_ABI bool isMustTailCall() const
Tests if this call site must be tail call optimized.
Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Get the attribute of a given kind from a given arg.
Definition InstrTypes.h:1646
bool hasRetAttr(StringRef Kind) const
Determine whether the return value has the given attribute.
Definition InstrTypes.h:1593
static bool classof(const Instruction *I)
Definition InstrTypes.h:1194
bool isDataOperand(Value::const_user_iterator UI) const
Definition InstrTypes.h:1247
Use & getCalledOperandUse()
Definition InstrTypes.h:1341
LLVM_ABI bool isIndirectCall() const
Return true if the callsite is an indirect call.
bool isNoInline() const
Return true if the call should not be inlined.
Definition InstrTypes.h:1912
bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const
Return true if the data operand at index i has the attribute A.
Definition InstrTypes.h:1674
static constexpr int CalledOperandOpEndIdx
The last operand is the called operand.
Definition InstrTypes.h:1126
LLVM_ABI bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
bool isBundleOperand(const Use *U) const
Returns true if the use is a bundle operand.
Definition InstrTypes.h:2027
bool isByValArgument(unsigned ArgNo) const
Determine whether this argument is passed by value.
Definition InstrTypes.h:1707
iterator_range< bundle_op_iterator > bundle_op_infos()
Return the range [bundle_op_info_begin, bundle_op_info_end).
Definition InstrTypes.h:2276
bool onlyWritesMemory(unsigned OpNo) const
Definition InstrTypes.h:1761
unsigned countOperandBundlesOfType(StringRef Name) const
Return the number of operand bundles with the tag Name attached to this instruction.
Definition InstrTypes.h:2057
LLVM_ABI void setOnlyReadsMemory()
void removeFnAttrs(const AttributeMask &AttrsToRemove)
Removes the attributes from the function.
Definition InstrTypes.h:1532
iterator_range< User::op_iterator > data_ops()
Definition InstrTypes.h:1229
const_bundle_op_iterator bundle_op_info_begin() const
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition InstrTypes.h:2253
void setCannotMerge()
Definition InstrTypes.h:1962
static LLVM_ABI CallBase * addOperandBundle(CallBase *CB, uint32_t ID, OperandBundleDef OB, InsertPosition InsertPt=nullptr)
Create a clone of CB with operand bundle OB added.
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
Definition InstrTypes.h:1357
iterator_range< User::const_op_iterator > args() const
Definition InstrTypes.h:1284
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Definition InstrTypes.h:1776
unsigned getBundleOperandsStartIndex() const
Return the index of the first bundle operand in the Use array.
Definition InstrTypes.h:2002
LLVM_ABI bool onlyAccessesInaccessibleMemOrArgMem() const
Determine if the function may only access memory that is either inaccessible from the IR or pointed t...
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
LLVM_ABI CaptureInfo getCaptureInfo(unsigned OpNo) const
Return which pointer components this operand may capture.
AttributeSet getRetAttributes() const
Return the return attributes for this call.
Definition InstrTypes.h:1428
Attribute getFnAttr(Attribute::AttrKind Kind) const
Get the attribute of a given kind for the function.
Definition InstrTypes.h:1638
User::op_iterator data_operands_end()
Definition InstrTypes.h:1221
bool onlyReadsMemory(unsigned OpNo) const
Definition InstrTypes.h:1749
void setNotConvergent()
Definition InstrTypes.h:1967
LLVM_ABI bool hasArgumentWithAdditionalReturnCaptureComponents() const
Returns whether the call has an argument that has an attribute like captures(ret: address,...
Type * getParamByValType(unsigned ArgNo) const
Extract the byval type for a call or parameter.
Definition InstrTypes.h:1794
bool isCallee(const Use *U) const
Determine whether this Use is the callee operand's Use.
Definition InstrTypes.h:1362
CallBase(AttributeList const &A, FunctionType *FT, ArgsTy &&... Args)
Definition InstrTypes.h:1132
const BundleOpInfo & getBundleOpInfoForOperand(unsigned OpIdx) const
Definition InstrTypes.h:2305
Value * getCalledOperand() const
Definition InstrTypes.h:1338
void setCalledFunction(FunctionCallee Fn)
Sets the function called, including updating the function type.
Definition InstrTypes.h:1390
const Use & getCalledOperandUse() const
Definition InstrTypes.h:1340
bool isArgOperand(Value::const_user_iterator UI) const
Definition InstrTypes.h:1315
LLVM_ABI void setOnlyWritesMemory()
LLVM_ABI op_iterator populateBundleOperandInfos(ArrayRef< OperandBundleDef > Bundles, const unsigned BeginIndex)
Populate the BundleOpInfo instances and the Use& vector from Bundles.
void removeRetAttr(Attribute::AttrKind Kind)
Removes the attribute from the return value.
Definition InstrTypes.h:1547
AttributeList Attrs
parameter attributes for callable
Definition InstrTypes.h:1128
void addDereferenceableRetAttr(uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
Definition InstrTypes.h:1579
unsigned getArgOperandNo(Value::const_user_iterator UI) const
Given a value use iterator, return the arg operand number corresponding to it.
Definition InstrTypes.h:1328
void setAttributes(AttributeList A)
Set the attributes for this call.
Definition InstrTypes.h:1425
Attribute getFnAttr(StringRef Kind) const
Get the attribute of a given kind for the function.
Definition InstrTypes.h:1630
void addAttributeAtIndex(unsigned i, Attribute::AttrKind Kind)
adds the attribute to the list of attributes.
Definition InstrTypes.h:1469
unsigned countOperandBundlesOfType(uint32_t ID) const
Return the number of operand bundles with the tag ID attached to this instruction.
Definition InstrTypes.h:2068
const Use & getArgOperandUse(unsigned i) const
Wrappers for getting the Use of a call argument.
Definition InstrTypes.h:1301
bool hasOperandBundlesOtherThan(ArrayRef< uint32_t > IDs) const
Return true if this operand bundle user contains operand bundles with tags other than those specified...
Definition InstrTypes.h:2156
bool returnDoesNotAlias() const
Determine if the return value is marked with NoAlias attribute.
Definition InstrTypes.h:1887
OperandBundleUse getOperandBundleForOperand(unsigned OpIdx) const
Return the operand bundle for the operand at index OpIdx.
Definition InstrTypes.h:2123
LLVM_ABI std::optional< ConstantRange > getRange() const
If this return value has a range attribute, return the value range of the argument.
bool doesNotThrow() const
Determine if the call cannot unwind.
Definition InstrTypes.h:1953
void addRetAttr(Attribute::AttrKind Kind)
Adds the attribute to the return value.
Definition InstrTypes.h:1489
Type * getParamElementType(unsigned ArgNo) const
Extract the elementtype type for a parameter.
Definition InstrTypes.h:1832
LLVM_ABI bool isReturnNonNull() const
Return true if the return value is known to be not null.
Value * getArgOperand(unsigned i) const
Definition InstrTypes.h:1290
FunctionType * FTy
Definition InstrTypes.h:1129
bool hasStructRetAttr() const
Determine if the call returns a structure through first pointer argument.
Definition InstrTypes.h:1971
uint64_t getRetDereferenceableBytes() const
Extract the number of dereferenceable bytes for a call or parameter (0=unknown).
Definition InstrTypes.h:1838
void removeAttributeAtIndex(unsigned i, Attribute::AttrKind Kind)
removes the attribute from the list of attributes.
Definition InstrTypes.h:1522
void setCannotDuplicate()
Definition InstrTypes.h:1958
User::const_op_iterator data_operands_begin() const
Definition InstrTypes.h:1218
void mutateFunctionType(FunctionType *FTy)
Definition InstrTypes.h:1205
void addRetAttrs(const AttrBuilder &B)
Adds attributes to the return value.
Definition InstrTypes.h:1499
uint64_t getParamDereferenceableOrNullBytes(unsigned i) const
Extract the number of dereferenceable_or_null bytes for a parameter (0=unknown).
Definition InstrTypes.h:1865
void setArgOperand(unsigned i, Value *v)
Definition InstrTypes.h:1295
Attribute getAttributeAtIndex(unsigned i, Attribute::AttrKind Kind) const
Get the attribute of a given kind at a position.
Definition InstrTypes.h:1620
bool bundleOperandHasAttr(unsigned OpIdx, Attribute::AttrKind A) const
Return true if the bundle operand at index OpIdx has the attribute A.
Definition InstrTypes.h:2137
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
Definition InstrTypes.h:1271
bool isBundleOperand(unsigned Idx) const
Return true if the operand at index Idx is a bundle operand.
Definition InstrTypes.h:2014
bool isConvergent() const
Determine if the invoke is convergent.
Definition InstrTypes.h:1965
FunctionType * getFunctionType() const
Definition InstrTypes.h:1203
LLVM_ABI Intrinsic::ID getIntrinsicID() const
Returns the intrinsic ID of the intrinsic called or Intrinsic::not_intrinsic if the called function i...
void setIsNoInline()
Definition InstrTypes.h:1913
static unsigned CountBundleInputs(ArrayRef< OperandBundleDef > Bundles)
Return the total number of values used in Bundles.
Definition InstrTypes.h:2311
LLVM_ABI Value * getArgOperandWithAttribute(Attribute::AttrKind Kind) const
If one of the arguments has the specified attribute, returns its operand value.
Value * getReturnedArgOperand() const
If one of the arguments has the 'returned' attribute, returns its operand value.
Definition InstrTypes.h:1893
LLVM_ABI void setOnlyAccessesInaccessibleMemory()
static LLVM_ABI CallBase * Create(CallBase *CB, ArrayRef< OperandBundleDef > Bundles, InsertPosition InsertPt=nullptr)
Create a clone of CB with a different set of operand bundles and insert it before InsertPt.
LLVM_ABI bool onlyWritesMemory() const
Determine if the call does not access or only writes memory.
unsigned data_operands_size() const
Definition InstrTypes.h:1238
void removeFnAttr(Attribute::AttrKind Kind)
Removes the attribute from the function.
Definition InstrTypes.h:1537
uint64_t getRetDereferenceableOrNullBytes() const
Extract the number of dereferenceable_or_null bytes for a call (0=unknown).
Definition InstrTypes.h:1853
iterator_range< User::op_iterator > args()
Iteration adapter for range-for loops.
Definition InstrTypes.h:1281
unsigned getArgOperandNo(const Use *U) const
Given a use for a arg operand, get the arg operand number that corresponds to it.
Definition InstrTypes.h:1321
bool isBundleOperand(Value::const_user_iterator UI) const
Definition InstrTypes.h:2032
LLVM_ABI bool hasClobberingOperandBundles() const
Return true if this operand bundle user has operand bundles that may write to the heap.
static bool classof(const Value *V)
Definition InstrTypes.h:1199
Value * getConvergenceControlToken() const
Return the convergence control token for this call, if it exists.
Definition InstrTypes.h:1187
void setCalledOperand(Value *V)
Definition InstrTypes.h:1382
void addParamAttrs(unsigned ArgNo, const AttrBuilder &B)
Adds attributes to the indicated argument.
Definition InstrTypes.h:1516
static LLVM_ABI CallBase * removeOperandBundle(CallBase *CB, uint32_t ID, InsertPosition InsertPt=nullptr)
Create a clone of CB with operand bundle ID removed.
bool doesNotReturn() const
Determine if the call cannot return.
Definition InstrTypes.h:1946
LLVM_ABI bool hasReadingOperandBundles() const
Return true if this operand bundle user has operand bundles that may read from the heap.
void removeFnAttr(StringRef Kind)
Removes the attribute from the function.
Definition InstrTypes.h:1542
void setConvergent()
Definition InstrTypes.h:1966
LLVM_ABI bool onlyAccessesArgMemory() const
Determine if the call can access memmory only using pointers based on its arguments.
unsigned arg_size() const
Definition InstrTypes.h:1288
void addDereferenceableParamAttr(unsigned i, uint64_t Bytes)
adds the dereferenceable attribute to the list of attributes.
Definition InstrTypes.h:1574
AttributeList getAttributes() const
Return the attributes for this call.
Definition InstrTypes.h:1422
std::optional< OperandBundleUse > getOperandBundle(uint32_t ID) const
Return an operand bundle by tag ID, if present.
Definition InstrTypes.h:2097
void addRetAttr(Attribute Attr)
Adds the attribute to the return value.
Definition InstrTypes.h:1494
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
Definition InstrTypes.h:1504
iterator_range< User::const_op_iterator > data_ops() const
Definition InstrTypes.h:1232
Instruction(const Instruction &)=delete
bool isArgOperand(const Use *U) const
Definition InstrTypes.h:1310
bool isDataOperand(const Use *U) const
Definition InstrTypes.h:1242
bool hasDeoptState() const
Return true if the call has deopt state bundle.
Definition InstrTypes.h:2295
LLVM_ABI void setMemoryEffects(MemoryEffects ME)
bool hasOperandBundles() const
Return true if this User has any operand bundles.
Definition InstrTypes.h:1999
void setCalledFunction(Function *Fn)
Sets the function called, including updating the function type.
Definition InstrTypes.h:1385
const_bundle_op_iterator bundle_op_info_end() const
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition InstrTypes.h:2270
bool isPassPointeeByValueArgument(unsigned ArgNo) const
Determine whether this argument is passed by value, in an alloca, or is preallocated.
Definition InstrTypes.h:1718
LLVM_ABI bool isTailCall() const
Tests if this call site is marked as a tail call.
const Function * getCaller() const
Definition InstrTypes.h:1366
void removeParamAttr(unsigned ArgNo, StringRef Kind)
Removes the attribute from the given argument.
Definition InstrTypes.h:1563
User::const_op_iterator arg_end() const
Definition InstrTypes.h:1276
LLVM_ABI Function * getCaller()
Helper to get the caller (the parent function).
bool tryIntersectAttributes(const CallBase *Other)
Try to intersect the attributes from 'this' CallBase and the 'Other' CallBase.
Definition InstrTypes.h:1441
const BundleOpInfo * const_bundle_op_iterator
Definition InstrTypes.h:2195
unsigned getNumTotalBundleOperands() const
Return the total number operands (not operand bundles) used by every operand bundle in this OperandBu...
Definition InstrTypes.h:2038
Attribute getAttributeAtIndex(unsigned i, StringRef Kind) const
Get the attribute of a given kind at a position.
Definition InstrTypes.h:1625
Represents which components of the pointer may be captured in which location.
This is the base class for all instructions that perform data casts.
Definition InstrTypes.h:448
Type * getSrcTy() const
Return the source type, as a convenience.
Definition InstrTypes.h:615
static LLVM_ABI Instruction::CastOps getCastOpcode(const Value *Val, bool SrcIsSigned, Type *Ty, bool DstIsSigned)
Returns the opcode necessary to cast Val into Ty using usual casting rules.
static LLVM_ABI CastInst * CreatePointerBitCastOrAddrSpaceCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a BitCast or an AddrSpaceCast cast instruction.
Instruction::CastOps getOpcode() const
Return the opcode of this CastInst.
Definition InstrTypes.h:610
static LLVM_ABI unsigned isEliminableCastPair(Instruction::CastOps firstOpcode, Instruction::CastOps secondOpcode, Type *SrcTy, Type *MidTy, Type *DstTy, const DataLayout *DL)
Determine how a pair of casts can be eliminated, if they can be at all.
static bool classof(const Value *V)
Definition InstrTypes.h:633
static LLVM_ABI CastInst * CreateIntegerCast(Value *S, Type *Ty, bool isSigned, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a ZExt, BitCast, or Trunc for int -> int casts.
static LLVM_ABI CastInst * CreateFPCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts.
CastInst(Type *Ty, unsigned iType, Value *S, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructor with insert-before-instruction semantics for subclasses.
Definition InstrTypes.h:451
static LLVM_ABI bool isBitOrNoopPointerCastable(Type *SrcTy, Type *DestTy, const DataLayout &DL)
Check whether a bitcast, inttoptr, or ptrtoint cast between these types is valid and a no-op.
static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy)
Definition InstrTypes.h:625
static LLVM_ABI bool isBitCastable(Type *SrcTy, Type *DestTy)
Check whether a bitcast between these types is valid.
static LLVM_ABI CastInst * CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a Trunc or BitCast cast instruction.
static LLVM_ABI CastInst * CreatePointerCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a BitCast, AddrSpaceCast or a PtrToInt cast instruction.
static LLVM_ABI CastInst * CreateBitOrPointerCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a BitCast, a PtrToInt, or an IntToPTr cast instruction.
static LLVM_ABI bool isNoopCast(Instruction::CastOps Opcode, Type *SrcTy, Type *DstTy, const DataLayout &DL)
A no-op cast is one that can be effected without changing any bits.
static LLVM_ABI CastInst * CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a ZExt or BitCast cast instruction.
static LLVM_ABI CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
LLVM_ABI bool isIntegerCast() const
There are several places where we need to know if a cast instruction only deals with integer source a...
Type * getDestTy() const
Return the destination type, as a convenience.
Definition InstrTypes.h:617
static LLVM_ABI CastInst * CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Create a SExt or BitCast cast instruction.
static LLVM_ABI bool castIsValid(Instruction::CastOps op, Type *SrcTy, Type *DstTy)
This method can be used to determine if a cast from SrcTy to DstTy using Opcode op is valid or not.
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition InstrTypes.h:630
This class is the base class for the comparison instructions.
Definition InstrTypes.h:664
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
Definition InstrTypes.h:982
Predicate getStrictPredicate() const
For example, SGE -> SGT, SLE -> SLT, ULE -> ULT, UGE -> UGT.
Definition InstrTypes.h:858
bool isEquality() const
Determine if this is an equals/not equals predicate.
Definition InstrTypes.h:915
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
Definition InstrTypes.h:768
bool isFalseWhenEqual() const
This is just a convenience.
Definition InstrTypes.h:948
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition InstrTypes.h:973
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition InstrTypes.h:676
@ FCMP_OEQ
0 0 0 1 True if ordered and equal
Definition InstrTypes.h:679
@ BAD_ICMP_PREDICATE
Definition InstrTypes.h:709
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
Definition InstrTypes.h:693
@ ICMP_SLT
signed less than
Definition InstrTypes.h:705
@ FIRST_ICMP_PREDICATE
Definition InstrTypes.h:707
@ ICMP_SLE
signed less or equal
Definition InstrTypes.h:706
@ FCMP_OLT
0 1 0 0 True if ordered and less than
Definition InstrTypes.h:682
@ FIRST_FCMP_PREDICATE
Definition InstrTypes.h:694
@ FCMP_ULE
1 1 0 1 True if unordered, less than, or equal
Definition InstrTypes.h:691
@ FCMP_OGT
0 0 1 0 True if ordered and greater than
Definition InstrTypes.h:680
@ FCMP_OGE
0 0 1 1 True if ordered and greater than or equal
Definition InstrTypes.h:681
@ ICMP_UGE
unsigned greater or equal
Definition InstrTypes.h:700
@ ICMP_UGT
unsigned greater than
Definition InstrTypes.h:699
@ ICMP_SGT
signed greater than
Definition InstrTypes.h:703
@ FCMP_ULT
1 1 0 0 True if unordered or less than
Definition InstrTypes.h:690
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
Definition InstrTypes.h:684
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
Definition InstrTypes.h:687
@ ICMP_ULT
unsigned less than
Definition InstrTypes.h:701
@ FCMP_UGT
1 0 1 0 True if unordered or greater than
Definition InstrTypes.h:688
@ FCMP_OLE
0 1 0 1 True if ordered and less than or equal
Definition InstrTypes.h:683
@ FCMP_ORD
0 1 1 1 True if ordered (no nans)
Definition InstrTypes.h:685
@ LAST_ICMP_PREDICATE
Definition InstrTypes.h:708
@ ICMP_EQ
equal
Definition InstrTypes.h:697
@ LAST_FCMP_PREDICATE
Definition InstrTypes.h:695
@ ICMP_NE
not equal
Definition InstrTypes.h:698
@ ICMP_SGE
signed greater or equal
Definition InstrTypes.h:704
@ FCMP_UNE
1 1 1 0 True if unordered or not equal
Definition InstrTypes.h:692
@ ICMP_ULE
unsigned less or equal
Definition InstrTypes.h:702
@ BAD_FCMP_PREDICATE
Definition InstrTypes.h:696
@ FCMP_UGE
1 0 1 1 True if unordered, greater than, or equal
Definition InstrTypes.h:689
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
Definition InstrTypes.h:678
@ FCMP_UNO
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
Definition InstrTypes.h:686
static auto ICmpPredicates()
Returns the sequence of all ICmp predicates.
Definition InstrTypes.h:722
LLVM_ABI bool isEquivalence(bool Invert=false) const
Determine if one operand of this compare can always be replaced by the other operand,...
bool isSigned() const
Definition InstrTypes.h:930
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
Definition InstrTypes.h:827
static auto FCmpPredicates()
Returns the sequence of all FCmp predicates.
Definition InstrTypes.h:715
Bitfield::Element< Predicate, 0, 6, LAST_ICMP_PREDICATE > PredicateField
Definition InstrTypes.h:711
bool isTrueWhenEqual() const
This is just a convenience.
Definition InstrTypes.h:942
static LLVM_ABI CmpInst * Create(OtherOps Op, Predicate Pred, Value *S1, Value *S2, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Construct a compare instruction, given the opcode, the predicate and the two operands.
Predicate getOrderedPredicate() const
Definition InstrTypes.h:800
static bool isFPPredicate(Predicate P)
Definition InstrTypes.h:770
Predicate getNonStrictPredicate() const
For example, SGT -> SGE, SLT -> SLE, ULT -> ULE, UGT -> UGE.
Definition InstrTypes.h:871
static LLVM_ABI CmpInst * CreateWithCopiedFlags(OtherOps Op, Predicate Pred, Value *S1, Value *S2, const Instruction *FlagsSource, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Construct a compare instruction, given the opcode, the predicate, the two operands and the instructio...
bool isNonStrictPredicate() const
Definition InstrTypes.h:852
bool isFPPredicate() const
Definition InstrTypes.h:782
LLVM_ABI void swapOperands()
This is just a convenience that dispatches to the subclasses.
static bool isRelational(Predicate P)
Return true if the predicate is relational (not EQ or NE).
Definition InstrTypes.h:923
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE,...
Definition InstrTypes.h:789
static LLVM_ABI StringRef getPredicateName(Predicate P)
Predicate getPredicate() const
Return the predicate for this instruction.
Definition InstrTypes.h:765
bool isStrictPredicate() const
Definition InstrTypes.h:843
static LLVM_ABI bool isUnordered(Predicate predicate)
Determine if the predicate is an unordered operation.
Predicate getFlippedStrictnessPredicate() const
For predicate of kind "is X or equal to 0" returns the predicate "is X".
Definition InstrTypes.h:893
static Predicate getOrderedPredicate(Predicate Pred)
Returns the ordered variant of a floating point compare.
Definition InstrTypes.h:796
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide more efficient getOperand methods.
bool isIntPredicate() const
Definition InstrTypes.h:783
static bool isIntPredicate(Predicate P)
Definition InstrTypes.h:776
Predicate getUnorderedPredicate() const
Definition InstrTypes.h:811
static LLVM_ABI bool isOrdered(Predicate predicate)
Determine if the predicate is an ordered operation.
LLVM_ABI CmpInst(Type *ty, Instruction::OtherOps op, Predicate pred, Value *LHS, Value *RHS, const Twine &Name="", InsertPosition InsertBefore=nullptr, Instruction *FlagsSource=nullptr)
static bool classof(const Value *V)
Definition InstrTypes.h:977
bool isUnsigned() const
Definition InstrTypes.h:936
static Predicate getUnorderedPredicate(Predicate Pred)
Returns the unordered variant of a floating point compare.
Definition InstrTypes.h:807
OtherOps getOpcode() const
Get the opcode casted to the right type.
Definition InstrTypes.h:760
LLVM_ABI bool isCommutative() const
This is just a convenience that dispatches to the subclasses.
bool isRelational() const
Return true if the predicate is relational (not EQ or NE).
Definition InstrTypes.h:926
This class represents a range of values.
A parsed version of the target data layout string in and methods for querying it.
This provides a helper for copying FMF from an instruction or setting specified flags.
Convenience struct for specifying and reasoning about fast-math flags.
Definition InstrTypes.h:2356
static bool classof(const Instruction *I)
Definition InstrTypes.h:2409
op_range arg_operands()
arg_operands - iteration adapter for range-for loops.
Definition InstrTypes.h:2401
void setArgOperand(unsigned i, Value *v)
Definition InstrTypes.h:2398
unsigned arg_size() const
arg_size - Return the number of funcletpad arguments.
Definition InstrTypes.h:2381
static bool classof(const Value *V)
Definition InstrTypes.h:2410
void setParentPad(Value *ParentPad)
Definition InstrTypes.h:2390
friend class CatchPadInst
Definition InstrTypes.h:2370
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition InstrTypes.h:2369
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide fast operand accessors.
Value * getParentPad() const
Convenience accessors.
Definition InstrTypes.h:2389
LLVM_ABI FuncletPadInst * cloneImpl() const
friend class CleanupPadInst
Definition InstrTypes.h:2371
const_op_range arg_operands() const
arg_operands - iteration adapter for range-for loops.
Definition InstrTypes.h:2404
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th funcletpad argument.
Definition InstrTypes.h:2397
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
FunctionType * getFunctionType()
Class to represent function types.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
BitfieldElement::Type getSubclassData() const
LLVM_ABI void setHasNoUnsignedWrap(bool b=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
LLVM_ABI void copyIRFlags(const Value *V, bool IncludeWrapFlags=true)
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this...
LLVM_ABI void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
LLVM_ABI void setFastMathFlags(FastMathFlags FMF)
Convenience function for setting multiple fast-math flags on this instruction, which must be an opera...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
LLVM_ABI void setIsExact(bool b=true)
Set or clear the exact flag on this instruction, which must be an operator which supports this flag.
Instruction(const Instruction &)=delete
void setSubclassData(typename BitfieldElement::Type Value)
A container for an operand bundle being viewed as a set of values rather than a set of uses.
Definition InstrTypes.h:1067
size_t input_size() const
Definition InstrTypes.h:1086
input_iterator input_end() const
Definition InstrTypes.h:1088
OperandBundleDefT(const OperandBundleUse &OBU)
Definition InstrTypes.h:1077
ArrayRef< InputTy > inputs() const
Definition InstrTypes.h:1082
typename std::vector< Value * >::const_iterator input_iterator
Definition InstrTypes.h:1084
OperandBundleDefT(std::string Tag, std::vector< InputTy > Inputs)
Definition InstrTypes.h:1072
input_iterator input_begin() const
Definition InstrTypes.h:1087
StringRef getTag() const
Definition InstrTypes.h:1090
OperandBundleDefT(std::string Tag, ArrayRef< InputTy > Inputs)
Definition InstrTypes.h:1074
An or instruction, which can be marked as "disjoint", indicating that the inputs don't have a 1 in th...
Definition InstrTypes.h:404
void setIsDisjoint(bool B)
Definition InstrTypes.h:408
bool isDisjoint() const
Definition InstrTypes.h:413
static bool classof(const Value *V)
Definition InstrTypes.h:419
@ IsDisjoint
Definition InstrTypes.h:406
static bool classof(const Instruction *I)
Definition InstrTypes.h:415
Instruction that can have a nneg flag (zext/uitofp).
Definition InstrTypes.h:639
static bool classof(const Instruction *I)
Definition InstrTypes.h:643
@ NonNeg
Definition InstrTypes.h:641
static bool classof(const Value *V)
Definition InstrTypes.h:653
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
Definition InstrTypes.h:58
static bool classof(const Instruction *I)
Definition InstrTypes.h:77
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
static bool classof(const Value *V)
Definition InstrTypes.h:85
UnaryInstruction(Type *Ty, unsigned iType, Value *V, InsertPosition InsertBefore=nullptr)
Definition InstrTypes.h:62
static LLVM_ABI UnaryOperator * Create(UnaryOps Op, Value *S, const Twine &Name=Twine(), InsertPosition InsertBefore=nullptr)
Construct a unary instruction, given the opcode and an operand.
LLVM_ABI UnaryOperator(UnaryOps iType, Value *S, Type *Ty, const Twine &Name, InsertPosition InsertBefore)
LLVM_ABI UnaryOperator * cloneImpl() const
static UnaryOperator * CreateWithCopiedFlags(UnaryOps Opc, Value *V, Instruction *CopyO, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Definition InstrTypes.h:139
UnaryOps getOpcode() const
Definition InstrTypes.h:154
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition InstrTypes.h:109
static UnaryOperator * CreateFNegFMF(Value *Op, Instruction *FMFSource, const Twine &Name="", InsertPosition InsertBefore=nullptr)
Definition InstrTypes.h:147
static bool classof(const Value *V)
Definition InstrTypes.h:162
static bool classof(const Instruction *I)
Definition InstrTypes.h:159
A Use represents the edge between a Value definition and its users.
iterator_range< const_op_iterator > const_op_range
const Use & getOperandUse(unsigned i) const
LLVM_ABI ArrayRef< const uint8_t > getDescriptor() const
Returns the descriptor co-allocated with this User instance.
void setOperand(unsigned i, Value *Val)
const Use * const_op_iterator
iterator_range< op_iterator > op_range
Value * getOperand(unsigned i) const
unsigned getNumOperands() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
user_iterator_impl< const User > const_user_iterator
unsigned char SubclassOptionalData
Hold subclass data that can be dropped.
LLVM_ABI void setName(const Twine &Name)
Change the name of the value.
void setValueSubclassData(unsigned short D)
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
void mutateType(Type *Ty)
Mutate the type of this Value to be of the specified type.
Base class of all SIMD vector types.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
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 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.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ MaxID
The highest possible ID. Must be some 2^k - 1.
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
This is an optimization pass for GlobalISel generic memory operations.
auto enum_seq_inclusive(EnumT Begin, EnumT End)
Iterate over an enum type from Begin to End inclusive.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
constexpr force_iteration_on_noniterable_enum_t force_iteration_on_noniterable_enum
MemoryEffectsBase< IRMemLocation > MemoryEffects
Summary of how a function affects memory in the program.
auto dyn_cast_or_null(const Y &Val)
FPClassTest
Floating-point class tests, supported by 'is_fpclass' intrinsic.
FunctionAddr VTableAddr Count
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
OperandBundleDefT< Value * > OperandBundleDef
@ Or
Bitwise or logical OR of integers.
@ Sub
Subtraction of integers.
DWARFExpression::Operation Op
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
bool capturesNothing(CaptureComponents CC)
OperandBundleDefT< const Value * > ConstOperandBundleDef
Definition InstrTypes.h:1094
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Describes an element of a Bitfield.
static constexpr unsigned NextBit
static constexpr bool areContiguous()
Used to keep track of an operand bundle.
Definition InstrTypes.h:2167
bool operator==(const BundleOpInfo &Other) const
Definition InstrTypes.h:2180
StringMapEntry< uint32_t > * Tag
The operand bundle tag, interned by LLVMContextImpl::getOrInsertBundleTag.
Definition InstrTypes.h:2170
uint32_t End
The index in the Use& vector where operands for this operand bundle ends.
Definition InstrTypes.h:2178
uint32_t Begin
The index in the Use& vector where operands for this operand bundle starts.
Definition InstrTypes.h:2174
FixedNumOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
A lightweight accessor for an operand bundle meant to be passed around by value.
Definition InstrTypes.h:1009
bool isFuncletOperandBundle() const
Return true if this is a "funclet" operand bundle.
Definition InstrTypes.h:1047
StringRef getTagName() const
Return the tag of this operand bundle as a string.
Definition InstrTypes.h:1028
bool isDeoptOperandBundle() const
Return true if this is a "deopt" operand bundle.
Definition InstrTypes.h:1042
OperandBundleUse()=default
OperandBundleUse(StringMapEntry< uint32_t > *Tag, ArrayRef< Use > Inputs)
Definition InstrTypes.h:1013
uint32_t getTagID() const
Return the tag of this operand bundle as an integer.
Definition InstrTypes.h:1037
ArrayRef< Use > Inputs
Definition InstrTypes.h:1010
bool operandHasAttr(unsigned Idx, Attribute::AttrKind A) const
Return true if the operand at index Idx in this operand bundle has the attribute A.
Definition InstrTypes.h:1018
bool isCFGuardTargetOperandBundle() const
Return true if this is a "cfguardtarget" operand bundle.
Definition InstrTypes.h:1052
Compile-time customization of User operands.
Information about how a User object was allocated, to be passed into the User constructor.
Indicates this User has operands co-allocated.
VariadicOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...