LLVM: include/llvm/IR/ModuleSummaryIndex.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_IR_MODULESUMMARYINDEX_H
16#define LLVM_IR_MODULESUMMARYINDEX_H
17
34#include
35#include
36#include
37#include
38#include
39#include
40#include
41#include
42#include
43#include
44#include <unordered_set>
45#include
46#include
47
48namespace llvm {
49
50template struct GraphTraits;
51
52namespace yaml {
53
55
56}
57
58
66 };
67
68
69
71
72
74
75
76
81
88
91 }
92
94
96
98
99
100
101
102
103
105 if (EntryFreq == 0)
106 return;
108 Scaled64 Temp(BlockFreq, ScaleShift);
109 Temp /= Scaled64::get(EntryFreq);
110
115 }
116};
117
119 switch (HT) {
121 return "unknown";
123 return "cold";
125 return "none";
127 return "hot";
129 return "critical";
130 }
132}
133
134class GlobalValueSummary;
135
137
141 if (HaveGVs)
142 GV = nullptr;
143 else
145 }
146
147
148
149
150
152
153
154
155
156
157
160
162
163
164
165
167};
168
169
170
171
172
173
174
176 std::map<GlobalValue::GUID, GlobalValueSummaryInfo>;
177
178
179
184
186 ValueInfo(bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R) {
189 }
190
191 explicit operator bool() const { return getRef(); }
192
196 return getRef()->second.U.GV;
197 }
198
200 return getRef()->second.SummaryList;
201 }
202
203
204
206
209 return haveGVs() ? getRef()->second.U.GV->getName()
210 : getRef()->second.U.Name;
211 }
212
217 }
221 }
225 }
229 }
231
232
235 }
239 }
240
241 const GlobalValueSummaryMapTy::value_type *getRef() const {
243 }
244
245
246
247
249
250
251
252 bool isDSOLocal(bool WithDSOLocalPropagation = false) const;
253
254
256};
257
259 OS << VI.getGUID();
260 if (!VI.name().empty())
261 OS << " (" << VI.name() << ")";
262 return OS;
263}
264
266 assert(A.getRef() && B.getRef() &&
267 "Need ValueInfo with non-null Ref for comparison");
268 return A.getRef() == B.getRef();
269}
270
272 assert(A.getRef() && B.getRef() &&
273 "Need ValueInfo with non-null Ref for comparison");
274 return A.getRef() != B.getRef();
275}
276
278 assert(A.getRef() && B.getRef() &&
279 "Need ValueInfo with non-null Ref to compare GUIDs");
280 return A.getGUID() < B.getGUID();
281}
282
285 return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-8);
286 }
287
289 return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-16);
290 }
291
293 return V == getTombstoneKey() || V == getEmptyKey();
294 }
295
297
298
299 assert(isSpecialKey(L) || isSpecialKey(R) || (L.haveGVs() == R.haveGVs()));
300 return L.getRef() == R.getRef();
301 }
303};
304
305
306
307
311};
312
313
315
317
318
319
320
321
322
323
324
325
327
328
329
330
331
333
340};
341
343 OS << "Callee: " << SNI.Callee;
344 bool First = true;
345 OS << " Clones: ";
346 for (auto V : SNI.Clones) {
348 OS << ", ";
350 OS << V;
351 }
353 OS << " StackIds: ";
356 OS << ", ";
358 OS << Id;
359 }
360 return OS;
361}
362
363
364
365
366
367
373 All = 7
374};
375
376
378
380
381
382
383
384
386
389};
390
393 bool First = true;
394 OS << " StackIds: ";
397 OS << ", ";
399 OS << Id;
400 }
401 return OS;
402}
403
404
406
407
408
409
410
411
412
413
415
416
418
419
420
421
422
423
424
426
429 }
432};
433
435 bool First = true;
436 OS << "Versions: ";
439 OS << ", ";
442 }
443 OS << " MIB:\n";
444 for (auto &M : AE.MIBs) {
445 OS << "\t\t" << M << "\n";
446 }
448 OS << "\tContextSizeInfo per MIB:\n";
450 OS << "\t\t";
451 bool FirstInfo = true;
452 for (auto [FullStackId, TotalSize] : Infos) {
453 if (!FirstInfo)
454 OS << ", ";
455 FirstInfo = false;
456 OS << "{ " << FullStackId << ", " << TotalSize << " }";
457 }
458 OS << "\n";
459 }
460 }
461 return OS;
462}
463
464
465
467public:
468
470
472
473
475
476
477
478
479
481 };
482
483
485
486
487
488
489
490
491
493
494
496
497
498
500
501
502
503
504
505
507
508
509
511
512
513
514
515
516
517
518
519
520
522
523
524
526
527
536 };
537
538private:
539
541
542 GVFlags Flags;
543
544
545
546
548
549
550
551
552
553
554
555
557
558
559
560
561
562
563
565
566protected:
569 : Kind(K), Flags(Flags), RefEdgeList(std::move(Refs)) {
571 "Expect no references for AliasSummary");
572 }
573
574public:
576
577
578
580
581
583
584
586
587
588
590
591
593
594
596
597
600 }
601
602
603
606 }
607
608
610
611 bool isLive() const { return Flags.Live; }
612
614
616
617 bool isDSOLocal() const { return Flags.DSOLocal; }
618
619 void setCanAutoHide(bool CanAutoHide) { Flags.CanAutoHide = CanAutoHide; }
620
621 bool canAutoHide() const { return Flags.CanAutoHide; }
622
625 }
626
628
630 return static_cast<ImportKind>(Flags.ImportType);
631 }
632
635 }
637 Flags.Visibility = (unsigned)Vis;
638 }
639
640
642
643
645
646
647
650
652};
653
655
656
659
660
661
662
663
665
666public:
669
670
673 }
674
676 AliaseeValueInfo = AliaseeVI;
677 AliaseeSummary = Aliasee;
678 }
679
681 assert(!!AliaseeSummary == (AliaseeValueInfo &&
683 "Expect to have both aliasee summary and summary list or neither");
684 return !!AliaseeSummary;
685 }
686
688 assert(AliaseeSummary && "Unexpected missing aliasee summary");
689 return *AliaseeSummary;
690 }
691
695 }
697 assert(AliaseeValueInfo && "Unexpected missing aliasee");
698 return AliaseeValueInfo;
699 }
701 assert(AliaseeValueInfo && "Unexpected missing aliasee");
702 return AliaseeValueInfo.getGUID();
703 }
704};
705
707 if (auto *AS = dyn_cast(this))
708 return &AS->getAliasee();
709 return this;
710}
711
713 if (auto *AS = dyn_cast(this))
714 return &AS->getAliasee();
715 return this;
716}
717
718
719
721public:
722
723 using EdgeTy = std::pair<ValueInfo, CalleeInfo>;
724
725
731
732
733
734
735
739 };
740
741
742
743
746 std::vector<uint64_t> Args;
747 };
748
749
750
752
753
754
756
757
758
759
761
762
763
764
767 };
768
769
771
772
777
778
780
782
783
785
787
788
790
791
792
793
794
795
797
809 return *this;
810 }
811
817 }
818
819 operator std::string() {
820 std::string Output;
822 OS << "funcFlags: (";
823 OS << "readNone: " << this->ReadNone;
824 OS << ", readOnly: " << this->ReadOnly;
825 OS << ", noRecurse: " << this->NoRecurse;
827 OS << ", noInline: " << this->NoInline;
828 OS << ", alwaysInline: " << this->AlwaysInline;
829 OS << ", noUnwind: " << this->NoUnwind;
830 OS << ", mayThrow: " << this->MayThrow;
833 OS << ")";
834 return Output;
835 }
836 };
837
838
841
842
843
844
849
853 };
854
856
857
858
859
861
862
863
864
866
870 };
871
872
873
880 true, true, false,
883 std::move(Edges), std::vectorGlobalValue::GUID(),
884 std::vectorFunctionSummary::VFuncId(),
885 std::vectorFunctionSummary::VFuncId(),
886 std::vectorFunctionSummary::ConstVCall(),
887 std::vectorFunctionSummary::ConstVCall(),
888 std::vectorFunctionSummary::ParamAccess(),
889 std::vector(), std::vector());
890 }
891
892
894
895private:
896
897
898 unsigned InstCount;
899
900
902
903
904
905
907
908 std::unique_ptr TIdInfo;
909
910
911 using ParamAccessesTy = std::vector;
912 std::unique_ptr ParamAccesses;
913
914
915
916
917
918
919
920 using CallsitesTy = std::vector;
921 std::unique_ptr Callsites;
922
923
924
925
926
927
928
929
930 using AllocsTy = std::vector;
931 std::unique_ptr Allocs;
932
933public:
937 std::vectorGlobalValue::GUID TypeTests,
938 std::vector TypeTestAssumeVCalls,
939 std::vector TypeCheckedLoadVCalls,
940 std::vector TypeTestAssumeConstVCalls,
941 std::vector TypeCheckedLoadConstVCalls,
942 std::vector Params, CallsitesTy CallsiteList,
943 AllocsTy AllocList)
945 InstCount(NumInsts), FunFlags(FunFlags),
946 CallGraphEdgeList(std::move(CGEdges)) {
947 if (!TypeTests.empty() || !TypeTestAssumeVCalls.empty() ||
948 !TypeCheckedLoadVCalls.empty() || !TypeTestAssumeConstVCalls.empty() ||
949 !TypeCheckedLoadConstVCalls.empty())
950 TIdInfo = std::make_unique(
951 TypeIdInfo{std::move(TypeTests), std::move(TypeTestAssumeVCalls),
952 std::move(TypeCheckedLoadVCalls),
953 std::move(TypeTestAssumeConstVCalls),
954 std::move(TypeCheckedLoadConstVCalls)});
955 if (!Params.empty())
956 ParamAccesses = std::make_unique(std::move(Params));
957 if (!CallsiteList.empty())
958 Callsites = std::make_unique(std::move(CallsiteList));
959 if (!AllocList.empty())
960 Allocs = std::make_unique(std::move(AllocList));
961 }
962
964
965
968 }
969
970
972
974
976
977
978 unsigned instCount() const { return InstCount; }
979
980
982
984
986
987
988
989
991 if (TIdInfo)
992 return TIdInfo->TypeTests;
993 return {};
994 }
995
996
997
998
1000 if (TIdInfo)
1001 return TIdInfo->TypeTestAssumeVCalls;
1002 return {};
1003 }
1004
1005
1006
1007
1009 if (TIdInfo)
1010 return TIdInfo->TypeCheckedLoadVCalls;
1011 return {};
1012 }
1013
1014
1015
1016
1018 if (TIdInfo)
1019 return TIdInfo->TypeTestAssumeConstVCalls;
1020 return {};
1021 }
1022
1023
1024
1026 if (TIdInfo)
1027 return TIdInfo->TypeCheckedLoadConstVCalls;
1028 return {};
1029 }
1030
1031
1033 if (ParamAccesses)
1034 return *ParamAccesses;
1035 return {};
1036 }
1037
1038
1040 if (NewParams.empty())
1041 ParamAccesses.reset();
1042 else if (ParamAccesses)
1043 *ParamAccesses = std::move(NewParams);
1044 else
1045 ParamAccesses = std::make_unique(std::move(NewParams));
1046 }
1047
1048
1049
1051 if (!TIdInfo)
1052 TIdInfo = std::make_unique();
1053 TIdInfo->TypeTests.push_back(Guid);
1054 }
1055
1057
1059 if (Callsites)
1060 return *Callsites;
1061 return {};
1062 }
1063
1066 return *Callsites;
1067 }
1068
1070 if (!Callsites)
1071 Callsites = std::make_unique();
1072 Callsites->push_back(Callsite);
1073 }
1074
1076 if (Allocs)
1077 return *Allocs;
1078 return {};
1079 }
1080
1083 return *Allocs;
1084 }
1085
1087};
1088
1091
1094 }
1095
1097 return L.GUID == R.GUID && L.Offset == R.Offset;
1098 }
1099
1101};
1102
1105 return {{0, uint64_t(-1)}, {}};
1106 }
1107
1109 return {{0, uint64_t(-2)}, {}};
1110 }
1111
1115 L.Args == R.Args;
1116 }
1117
1119 return I.VFunc.GUID;
1120 }
1121};
1122
1123
1124
1128
1131};
1132
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1145private:
1146
1147
1148 std::unique_ptr VTableFuncs;
1149
1150public:
1156
1157
1158
1159
1160
1161
1163
1164
1165
1167
1168
1169
1170
1171
1172
1173
1174
1176
1177
1180
1185
1186
1189 }
1190
1199 }
1202 }
1203
1205 assert(!VTableFuncs);
1206 VTableFuncs = std::make_unique(std::move(Funcs));
1207 }
1208
1210 if (VTableFuncs)
1211 return *VTableFuncs;
1212 return {};
1213 }
1214};
1215
1217
1218
1219
1220
1226 AllOnes,
1230
1231
1232
1233
1235
1236
1237
1238
1239
1240
1245};
1246
1251 BranchFunnel,
1252
1255
1257
1265
1266
1267
1268
1269
1271
1272
1273
1274
1277 };
1278
1279
1280
1282};
1283
1286
1287
1288
1289 std::map<uint64_t, WholeProgramDevirtResolution> WPDRes;
1290};
1291
1292
1294
1295
1298
1299
1300
1302
1303
1304
1306
1307
1308
1310 std::map<std::string, GVSummaryMapTy, std::less<>>;
1311
1312
1314
1315
1316
1318 std::multimap<GlobalValue::GUID, std::pair<StringRef, TypeIdSummary>>;
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1333
1336};
1337
1338
1339
1340
1342
1343
1344
1346private:
1347
1348
1350
1351
1353
1356
1357
1358
1360
1361
1362
1363
1364
1365 std::map<StringRef, TypeIdCompatibleVtableInfo, std::less<>>
1366 TypeIdCompatibleVtableMap;
1367
1368
1369
1371
1372
1373
1374
1375 bool WithGlobalValueDeadStripping = false;
1376
1377
1378
1379
1380 bool WithAttributePropagation = false;
1381
1382
1383
1384 bool WithDSOLocalPropagation = false;
1385
1386
1387 bool WithWholeProgramVisibility = false;
1388
1389
1390 bool HasSyntheticEntryCounts = false;
1391
1392
1393 bool WithSupportsHotColdNew = false;
1394
1395
1396
1397
1398
1399
1400 bool SkipModuleByDistributedBackend = false;
1401
1402
1403
1404
1405
1406 bool HaveGVs;
1407
1408
1409 bool EnableSplitLTOUnit;
1410
1411
1412 bool UnifiedLTO;
1413
1414
1415
1416 bool PartiallySplitLTOUnits = false;
1417
1418
1419 bool HasParamAccess = false;
1420
1421 std::set<std::string, std::less<>> CfiFunctionDefs;
1422 std::set<std::string, std::less<>> CfiFunctionDecls;
1423
1424
1425
1428
1429
1430
1431
1432
1433
1434
1435
1437
1438
1439
1440
1441
1442 std::vector<uint64_t> StackIds;
1443
1444
1445
1447
1448
1450
1451 GlobalValueSummaryMapTy::value_type *
1454 .first;
1455 }
1456
1457public:
1458
1460 bool UnifiedLTO = false)
1461 : TypeIdSaver(TypeIdSaverAlloc), HaveGVs(HaveGVs),
1462 EnableSplitLTOUnit(EnableSplitLTOUnit), UnifiedLTO(UnifiedLTO),
1463 Saver(Alloc) {}
1464
1465
1466
1467
1468
1469
1471
1472
1474 return "[Regular LTO]";
1475 }
1476
1477 bool haveGVs() const { return HaveGVs; }
1478
1481
1485
1490 size_t size() const { return GlobalValueMap.size(); }
1491
1492 const std::vector<uint64_t> &stackIds() const { return StackIds; }
1493
1495 auto Inserted = StackIdToIndex.insert({StackId, StackIds.size()});
1496 if (Inserted.second)
1497 StackIds.push_back(StackId);
1498 return Inserted.first->second;
1499 }
1500
1503 return StackIds[Index];
1504 }
1505
1506
1507
1508
1509
1510
1512 assert(StackIdToIndex.size() == StackIds.size());
1513 StackIdToIndex.clear();
1514 StackIds.shrink_to_fit();
1515 }
1516
1517
1518
1520 std::map<ValueInfo, bool> &FunctionHasParent) {
1521 if (!V.getSummaryList().size())
1522 return;
1523
1524
1525 auto S = FunctionHasParent.emplace(V, false);
1526
1527
1528 if (!S.second)
1529 return;
1530
1532 dyn_cast(V.getSummaryList().front().get());
1533 assert(F != nullptr && "Expected FunctionSummary node");
1534
1535 for (const auto &C : F->calls()) {
1536
1537 auto S = FunctionHasParent.emplace(C.first, true);
1538
1539
1540 if (!S.second && S.first->second)
1541 continue;
1542
1543 if (S.second)
1545 else
1546 S.first->second = true;
1547 }
1548 }
1549
1550
1552
1553
1554
1555 std::map<ValueInfo, bool> FunctionHasParent;
1556
1557 for (auto &S : *this) {
1558
1559 if (!S.second.SummaryList.size() ||
1560 !isa(S.second.SummaryList.front().get()))
1561 continue;
1563 }
1564
1566
1567 for (auto &P : FunctionHasParent) {
1568 if (P.second)
1569 continue;
1571 }
1573 }
1574
1576 return WithGlobalValueDeadStripping;
1577 }
1579 WithGlobalValueDeadStripping = true;
1580 }
1581
1584 WithAttributePropagation = true;
1585 }
1586
1589
1592
1594 return WithAttributePropagation && GVS->maybeReadOnly();
1595 }
1597 return WithAttributePropagation && GVS->maybeWriteOnly();
1598 }
1599
1602
1604 return SkipModuleByDistributedBackend;
1605 }
1607 SkipModuleByDistributedBackend = true;
1608 }
1609
1612
1615
1618
1620
1622 return !WithGlobalValueDeadStripping || GVS->isLive();
1623 }
1625
1626
1627
1630 }
1631
1632
1634 auto I = GlobalValueMap.find(GUID);
1635 return ValueInfo(HaveGVs, I == GlobalValueMap.end() ? nullptr : &*I);
1636 }
1637
1638
1640 return ValueInfo(HaveGVs, getOrInsertValuePtr(GUID));
1641 }
1642
1643
1644
1645
1647
1648
1651 auto VP = getOrInsertValuePtr(GUID);
1652 VP->second.U.Name = Name;
1654 }
1655
1656
1659 auto VP = getOrInsertValuePtr(GV->getGUID());
1660 VP->second.U.GV = GV;
1662 }
1663
1664
1666 const auto I = OidGuidMap.find(OriginalID);
1667 return I == OidGuidMap.end() ? 0 : I->second;
1668 }
1669
1671 return CfiFunctionDefs;
1672 }
1674 return CfiFunctionDefs;
1675 }
1676
1678 return CfiFunctionDecls;
1679 }
1681 return CfiFunctionDecls;
1682 }
1683
1684
1686 std::unique_ptr Summary) {
1688 }
1689
1690
1692 std::unique_ptr Summary) {
1694 std::move(Summary));
1695 }
1696
1697
1699 std::unique_ptr Summary) {
1700 if (const FunctionSummary *FS = dyn_cast(Summary.get()))
1701 HasParamAccess |= !FS->paramAccesses().empty();
1702 addOriginalName(VI.getGUID(), Summary->getOriginalName());
1703
1704
1705 const_cast<GlobalValueSummaryMapTy::value_type *>(VI.getRef())
1706 ->second.SummaryList.push_back(std::move(Summary));
1707 }
1708
1709
1712 if (OrigGUID == 0 || ValueGUID == OrigGUID)
1713 return;
1714 auto [It, Inserted] = OidGuidMap.try_emplace(OrigGUID, ValueGUID);
1715 if (!Inserted && It->second != ValueGUID)
1716 It->second = 0;
1717 }
1718
1719
1720
1722 auto SummaryList = VI.getSummaryList();
1723 auto Summary =
1725 [&](const std::unique_ptr &Summary) {
1726 return Summary->modulePath() == ModuleId;
1727 });
1728 if (Summary == SummaryList.end())
1729 return nullptr;
1730 return Summary->get();
1731 }
1732
1733
1734
1739 return nullptr;
1741 }
1742
1743
1744
1746 bool PerModuleIndex = true) const {
1747 assert(GV.hasName() && "Can't get GlobalValueSummary for GV with no name");
1749 }
1750
1751
1752
1753
1755 bool PerModuleIndex = true) const;
1756
1757
1759 return ModulePathStringTable;
1760 }
1761
1762
1764
1765
1767 auto It = ModulePathStringTable.find(ModPath);
1768 assert(It != ModulePathStringTable.end() && "Module not registered");
1769 return It->second;
1770 }
1771
1772
1773
1775 std::string Suffix = utostr((uint64_t(ModHash[0]) << 32) |
1776 ModHash[1]);
1778 }
1779
1782 NewName += ".llvm.";
1783 NewName += Suffix;
1784 return std::string(NewName);
1785 }
1786
1787
1788
1789
1790
1792 std::pair<StringRef, StringRef> Pair = Name.rsplit(".llvm.");
1793 return Pair.first;
1794 }
1795
1797
1798
1799
1801 return &*ModulePathStringTable.insert({ModPath, Hash}).first;
1802 }
1803
1804
1806 auto It = ModulePathStringTable.find(ModPath);
1807 assert(It != ModulePathStringTable.end() && "Module not registered");
1808 return &*It;
1809 }
1810
1811
1813 auto It = ModulePathStringTable.find(ModPath);
1814 assert(It != ModulePathStringTable.end() && "Module not registered");
1815 return &*It;
1816 }
1817
1818
1819
1820
1822 return ModulePathStringTable.count(M.getModuleIdentifier());
1823 }
1824
1826
1827
1828
1829
1832 for (auto &[GUID, TypeIdPair] : make_range(TidIter))
1833 if (TypeIdPair.first == TypeId)
1834 return TypeIdPair.second;
1837 return It->second.second;
1838 }
1839
1840
1841
1844 for (const auto &[GUID, TypeIdPair] : make_range(TidIter))
1845 if (TypeIdPair.first == TypeId)
1846 return &TypeIdPair.second;
1847 return nullptr;
1848 }
1849
1853 TypeId));
1854 }
1855
1857 return TypeIdCompatibleVtableMap;
1858 }
1859
1860
1861
1862
1865 return TypeIdCompatibleVtableMap[TypeIdSaver.save(TypeId)];
1866 }
1867
1868
1869
1870 std::optional
1872 auto I = TypeIdCompatibleVtableMap.find(TypeId);
1873 if (I == TypeIdCompatibleVtableMap.end())
1874 return std::nullopt;
1875 return I->second;
1876 }
1877
1878
1879
1882
1883
1884
1885 template
1886 void
1888 for (const auto &GlobalList : *this) {
1889 auto GUID = GlobalList.first;
1890 for (const auto &Summary : GlobalList.second.SummaryList) {
1891 ModuleToDefinedGVSummaries[Summary->modulePath()][GUID] = Summary.get();
1892 }
1893 }
1894 }
1895
1896
1898
1899
1900 void dump() const;
1901
1902
1903 void
1906
1907
1909
1910
1912
1913
1915
1916
1917
1919 bool &CanImportDecl) const;
1920};
1921
1922
1926
1928 return P.first;
1929 }
1932 decltype(&valueInfoFromEdge)>;
1933
1936
1938
1940 if (.getSummaryList().size())
1943 &valueInfoFromEdge);
1945 cast(N.getSummaryList().front()->getBaseObject());
1946 return ChildIteratorType(F->CallGraphEdgeList.begin(), &valueInfoFromEdge);
1947 }
1948
1950 if (.getSummaryList().size())
1953 &valueInfoFromEdge);
1955 cast(N.getSummaryList().front()->getBaseObject());
1956 return ChildIteratorType(F->CallGraphEdgeList.end(), &valueInfoFromEdge);
1957 }
1958
1960 if (.getSummaryList().size())
1962
1964 cast(N.getSummaryList().front()->getBaseObject());
1965 return F->CallGraphEdgeList.begin();
1966 }
1967
1969 if (.getSummaryList().size())
1971
1973 cast(N.getSummaryList().front()->getBaseObject());
1974 return F->CallGraphEdgeList.end();
1975 }
1976
1978};
1979
1980template <>
1983 std::unique_ptr Root =
1984 std::make_unique(I->calculateCallGraphRoot());
1986 G.SummaryList.push_back(std::move(Root));
1987 static auto P =
1988 GlobalValueSummaryMapTy::value_type(GlobalValue::GUID(0), std::move(G));
1990 }
1991};
1992}
1993
1994#endif
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
This file defines the StringMap class.
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Looks at all the uses of the given value Returns the Liveness deduced from the uses of this value Adds all uses that cause the result to be MaybeLive to MaybeLiveRetUses If the result is Live
This file defines the DenseMap class.
static const char * PreservedSymbols[]
Module.h This file contains the declarations for the Module class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
This file defines the SmallVector class.
Alias summary information.
GlobalValue::GUID getAliaseeGUID() const
const GlobalValueSummary & getAliasee() const
ValueInfo getAliaseeVI() const
static bool classof(const GlobalValueSummary *GVS)
Check if this is an alias summary.
AliasSummary(GVFlags Flags)
GlobalValueSummary & getAliasee()
void setAliasee(ValueInfo &AliaseeVI, GlobalValueSummary *Aliasee)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Allocate memory in an ever growing pool, as if by bump-pointer.
This class represents a range of values.
This is an important base class in LLVM.
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Implements a dense probed hash-table based set.
Function summary information to aid decisions and implementation of importing.
static FunctionSummary ExternalNode
A dummy node to reference external functions that aren't in the index.
void addCallsite(CallsiteInfo &Callsite)
static FunctionSummary makeDummyFunctionSummary(SmallVectorImpl< FunctionSummary::EdgeTy > &&Edges)
Create an empty FunctionSummary (with specified call edges).
FunctionSummary(GVFlags Flags, unsigned NumInsts, FFlags FunFlags, SmallVectorImpl< ValueInfo > &&Refs, SmallVectorImpl< EdgeTy > &&CGEdges, std::vector< GlobalValue::GUID > TypeTests, std::vector< VFuncId > TypeTestAssumeVCalls, std::vector< VFuncId > TypeCheckedLoadVCalls, std::vector< ConstVCall > TypeTestAssumeConstVCalls, std::vector< ConstVCall > TypeCheckedLoadConstVCalls, std::vector< ParamAccess > Params, CallsitesTy CallsiteList, AllocsTy AllocList)
ArrayRef< VFuncId > type_test_assume_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type....
AllocsTy & mutableAllocs()
ArrayRef< ConstVCall > type_test_assume_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.assume(llvm.type....
std::pair< ValueInfo, CalleeInfo > EdgeTy
<CalleeValueInfo, CalleeInfo> call edge pair.
std::pair< unsigned, unsigned > specialRefCounts() const
SmallVector< EdgeTy, 0 > & mutableCalls()
ArrayRef< AllocInfo > allocs() const
ArrayRef< CallsiteInfo > callsites() const
void addTypeTest(GlobalValue::GUID Guid)
Add a type test to the summary.
ArrayRef< VFuncId > type_checked_load_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics that ...
void setParamAccesses(std::vector< ParamAccess > NewParams)
Sets the list of known uses of pointer parameters.
unsigned instCount() const
Get the instruction count recorded for this function.
const TypeIdInfo * getTypeIdInfo() const
ArrayRef< ConstVCall > type_checked_load_const_vcalls() const
Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics with ...
ArrayRef< EdgeTy > calls() const
Return the list of <CalleeValueInfo, CalleeInfo> pairs.
ArrayRef< ParamAccess > paramAccesses() const
Returns the list of known uses of pointer parameters.
CallsitesTy & mutableCallsites()
ForceSummaryHotnessType
Types for -force-summary-edges-cold debugging option.
FFlags fflags() const
Get function summary flags.
ArrayRef< GlobalValue::GUID > type_tests() const
Returns the list of type identifiers used by this function in llvm.type.test intrinsics other than by...
static bool classof(const GlobalValueSummary *GVS)
Check if this is a function summary.
Function and variable summary information to aid decisions and implementation of importing.
SummaryKind
Sububclass discriminator (for dyn_cast<> et al.)
GVFlags flags() const
Get the flags for this GlobalValue (see struct GVFlags).
void setDSOLocal(bool Local)
StringRef modulePath() const
Get the path to the module containing this function.
GlobalValueSummary * getBaseObject()
If this is an alias summary, returns the summary of the aliased object (a global variable or function...
SummaryKind getSummaryKind() const
Which kind of summary subclass this is.
GlobalValue::GUID getOriginalName() const
Returns the hash of the original name, it is identical to the GUID for externally visible symbols,...
GlobalValue::VisibilityTypes getVisibility() const
ArrayRef< ValueInfo > refs() const
Return the list of values referenced by this global value definition.
bool shouldImportAsDecl() const
void setLinkage(GlobalValue::LinkageTypes Linkage)
Sets the linkage to the value determined by global summary-based optimization.
void setVisibility(GlobalValue::VisibilityTypes Vis)
virtual ~GlobalValueSummary()=default
GlobalValueSummary::ImportKind importType() const
void setModulePath(StringRef ModPath)
Set the path to the module containing this function, for use in the combined index.
void setNotEligibleToImport()
Flag that this global value cannot be imported.
void setCanAutoHide(bool CanAutoHide)
GlobalValueSummary(SummaryKind K, GVFlags Flags, SmallVectorImpl< ValueInfo > &&Refs)
GlobalValue::LinkageTypes linkage() const
Return linkage type recorded for this global value.
bool notEligibleToImport() const
Return true if this global value can't be imported.
void setImportKind(ImportKind IK)
void setOriginalName(GlobalValue::GUID Name)
Initialize the original name hash in this summary.
static GUID getGUID(StringRef GlobalName)
Return a 64-bit global unique ID constructed from global value name (i.e.
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
VisibilityTypes
An enumeration for the kinds of visibility of global values.
@ DefaultVisibility
The GV is visible.
LinkageTypes
An enumeration for the kinds of linkage for global values.
@ AvailableExternallyLinkage
Available for inspection, not emission.
Global variable summary information to aid decisions and implementation of importing.
void setWriteOnly(bool WO)
bool maybeWriteOnly() const
void setVCallVisibility(GlobalObject::VCallVisibility Vis)
struct llvm::GlobalVarSummary::GVarFlags VarFlags
GVarFlags varflags() const
bool maybeReadOnly() const
void setReadOnly(bool RO)
ArrayRef< VirtFuncOffset > vTableFuncs() const
GlobalVarSummary(GVFlags Flags, GVarFlags VarFlags, SmallVectorImpl< ValueInfo > &&Refs)
GlobalObject::VCallVisibility getVCallVisibility() const
static bool classof(const GlobalValueSummary *GVS)
Check if this is a global variable summary.
void setVTableFuncs(VTableFuncList Funcs)
Class to hold module path string table and global value map, and encapsulate methods for operating on...
bool withAttributePropagation() const
TypeIdSummary & getOrInsertTypeIdSummary(StringRef TypeId)
Return an existing or new TypeIdSummary entry for TypeId.
std::optional< TypeIdCompatibleVtableInfo > getTypeIdCompatibleVtableSummary(StringRef TypeId) const
For the given TypeId, this returns the TypeIdCompatibleVtableMap entry if present in the summary map.
void addGlobalValueSummary(ValueInfo VI, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for the given ValueInfo.
ModulePathStringTableTy::value_type ModuleInfo
uint64_t getBlockCount() const
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID)
Return a ValueInfo for GUID.
bool withGlobalValueDeadStripping() const
static void discoverNodes(ValueInfo V, std::map< ValueInfo, bool > &FunctionHasParent)
Convenience function for doing a DFS on a ValueInfo.
StringRef saveString(StringRef String)
bool withWholeProgramVisibility() const
const TypeIdSummaryMapTy & typeIds() const
static StringRef getOriginalNameBeforePromote(StringRef Name)
Helper to obtain the unpromoted name for a global value (or the original name if not promoted).
const TypeIdSummary * getTypeIdSummary(StringRef TypeId) const
This returns either a pointer to the type id summary (if present in the summary map) or null (if not ...
bool isGUIDLive(GlobalValue::GUID GUID) const
gvsummary_iterator begin()
const_gvsummary_iterator end() const
bool isReadOnly(const GlobalVarSummary *GVS) const
void setFlags(uint64_t Flags)
const_gvsummary_iterator begin() const
bool isWriteOnly(const GlobalVarSummary *GVS) const
void addBlockCount(uint64_t C)
void setPartiallySplitLTOUnits()
const std::vector< uint64_t > & stackIds() const
GlobalValueSummary * findSummaryInModule(GlobalValue::GUID ValueGUID, StringRef ModuleId) const
Find the summary for global GUID in module ModuleId, or nullptr if not found.
void releaseTemporaryMemory()
void setBlockCount(uint64_t C)
ValueInfo getValueInfo(const GlobalValueSummaryMapTy::value_type &R) const
Return a ValueInfo for the index value_type (convenient when iterating index).
const ModuleHash & getModuleHash(const StringRef ModPath) const
Get the module SHA1 hash recorded for the given module path.
static constexpr const char * getRegularLTOModuleName()
void setEnableSplitLTOUnit()
void addGlobalValueSummary(StringRef ValueName, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value of the given name.
ModuleSummaryIndex(bool HaveGVs, bool EnableSplitLTOUnit=false, bool UnifiedLTO=false)
bool partiallySplitLTOUnits() const
void collectDefinedFunctionsForModule(StringRef ModulePath, GVSummaryMapTy &GVSummaryMap) const
Collect for the given module the list of functions it defines (GUID -> Summary).
const std::set< std::string, std::less<> > & cfiFunctionDecls() const
const auto & typeIdCompatibleVtableMap() const
void dumpSCCs(raw_ostream &OS)
Print out strongly connected components for debugging.
bool isGlobalValueLive(const GlobalValueSummary *GVS) const
bool enableSplitLTOUnit() const
void setWithSupportsHotColdNew()
const ModuleInfo * getModule(StringRef ModPath) const
Return module entry for module with the given ModPath.
void propagateAttributes(const DenseSet< GlobalValue::GUID > &PreservedSymbols)
Do the access attribute and DSOLocal propagation in combined index.
void setSkipModuleByDistributedBackend()
const std::set< std::string, std::less<> > & cfiFunctionDefs() const
void setWithAttributePropagation()
const StringMap< ModuleHash > & modulePaths() const
Table of modules, containing module hash and id.
bool withSupportsHotColdNew() const
void dump() const
Dump to stderr (for debugging).
ModuleInfo * addModule(StringRef ModPath, ModuleHash Hash=ModuleHash{{0}})
Add a new module with the given Hash, mapped to the given ModID, and return a reference to the module...
void collectDefinedGVSummariesPerModule(Map &ModuleToDefinedGVSummaries) const
Collect for each module the list of Summaries it defines (GUID -> Summary).
void addGlobalValueSummary(const GlobalValue &GV, std::unique_ptr< GlobalValueSummary > Summary)
Add a global value summary for a value.
bool hasExportedFunctions(const Module &M) const
Check if the given Module has any functions available for exporting in the index.
std::set< std::string, std::less<> > & cfiFunctionDefs()
static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash)
Convenience method for creating a promoted global name for the given value name of a local,...
static constexpr uint64_t BitcodeSummaryVersion
bool withDSOLocalPropagation() const
void exportToDot(raw_ostream &OS, const DenseSet< GlobalValue::GUID > &GUIDPreservedSymbols) const
Export summary to dot file for GraphViz.
bool hasUnifiedLTO() const
bool hasParamAccess() const
void setWithDSOLocalPropagation()
uint64_t getStackIdAtIndex(unsigned Index) const
StringMap< ModuleHash > & modulePaths()
Table of modules, containing hash and id.
void print(raw_ostream &OS, bool IsForDebug=false) const
Print to an output stream.
bool skipModuleByDistributedBackend() const
ValueInfo getOrInsertValueInfo(const GlobalValue *GV)
Return a ValueInfo for GV and mark it as belonging to GV.
std::set< std::string, std::less<> > & cfiFunctionDecls()
GlobalValueSummary * findSummaryInModule(ValueInfo VI, StringRef ModuleId) const
Find the summary for ValueInfo VI in module ModuleId, or nullptr if not found.
ValueInfo getValueInfo(GlobalValue::GUID GUID) const
Return a ValueInfo for GUID if it exists, otherwise return ValueInfo().
uint64_t getFlags() const
unsigned addOrGetStackIdIndex(uint64_t StackId)
GlobalValue::GUID getGUIDFromOriginalID(GlobalValue::GUID OriginalID) const
Return the GUID for OriginalId in the OidGuidMap.
GlobalValueSummary * getGlobalValueSummary(const GlobalValue &GV, bool PerModuleIndex=true) const
Returns the first GlobalValueSummary for GV, asserting that there is only one if PerModuleIndex.
void setWithGlobalValueDeadStripping()
ModuleInfo * getModule(StringRef ModPath)
Return module entry for module with the given ModPath.
ValueInfo getOrInsertValueInfo(GlobalValue::GUID GUID, StringRef Name)
Return a ValueInfo for GUID setting value Name.
void setWithWholeProgramVisibility()
bool canImportGlobalVar(const GlobalValueSummary *S, bool AnalyzeRefs) const
Checks if we can import global variable from another module.
static std::string getGlobalNameForLocal(StringRef Name, StringRef Suffix)
void addOriginalName(GlobalValue::GUID ValueGUID, GlobalValue::GUID OrigGUID)
Add an original name for the value of the given GUID.
FunctionSummary calculateCallGraphRoot()
TypeIdSummary * getTypeIdSummary(StringRef TypeId)
TypeIdCompatibleVtableInfo & getOrInsertTypeIdCompatibleVtableSummary(StringRef TypeId)
Return an existing or new TypeIdCompatibleVtableMap entry for TypeId.
A Module instance is used to store all the information related to an LLVM module.
PointerIntPair - This class implements a pair of a pointer and small integer.
void setPointer(PointerTy PtrVal) &
void setInt(IntType IntVal) &
PointerTy getPointer() const
Simple representation of a scaled number.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
iterator find(StringRef Key)
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
StringRef save(const char *S)
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
StringRef save(const char *S)
A Use represents the edge between a Value definition and its users.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Cold
Attempts to make code in the caller as efficient as possible under the assumption that the call is no...
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
GlobalValueSummaryMapTy::iterator gvsummary_iterator
bool operator<(int64_t V1, const APSInt &V2)
const char * getHotnessName(CalleeInfo::HotnessType HT)
bool operator!=(uint64_t V1, const APInt &V2)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
std::vector< VirtFuncOffset > VTableFuncList
List of functions referenced by a particular vtable definition.
std::vector< std::unique_ptr< GlobalValueSummary > > GlobalValueSummaryList
@ First
Helpers to iterate all locations in the MemoryEffectsBase class.
std::unordered_set< GlobalValueSummary * > GVSummaryPtrSet
A set of global value summary pointers.
GlobalValueSummaryMapTy::const_iterator const_gvsummary_iterator
Type used for iterating through the global value summary map.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
std::map< std::string, GVSummaryMapTy, std::less<> > ModuleToSummariesForIndexTy
Map of a module name to the GUIDs and summaries we will import from that module.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
std::multimap< GlobalValue::GUID, std::pair< StringRef, TypeIdSummary > > TypeIdSummaryMapTy
Map of a type GUID to type id string and summary (multimap used in case of GUID conflicts).
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
std::array< uint32_t, 5 > ModuleHash
160 bits SHA1
std::map< GlobalValue::GUID, GlobalValueSummaryInfo > GlobalValueSummaryMapTy
Map from global value GUID to corresponding summary structures.
std::vector< TypeIdOffsetVtableInfo > TypeIdCompatibleVtableInfo
List of vtable definitions decorated by a particular type identifier, and their corresponding offsets...
Implement std::hash so that hash_code can be used in STL containers.
Summary of memprof metadata on allocations.
AllocInfo(std::vector< MIBInfo > MIBs)
AllocInfo(SmallVector< uint8_t > Versions, std::vector< MIBInfo > MIBs)
std::vector< std::vector< ContextTotalSize > > ContextSizeInfos
SmallVector< uint8_t > Versions
std::vector< MIBInfo > MIBs
Class to accumulate and hold information about a callee.
static constexpr uint64_t MaxRelBlockFreq
void updateHotness(const HotnessType OtherHotness)
CalleeInfo(HotnessType Hotness, bool HasTC, uint64_t RelBF)
HotnessType getHotness() const
static constexpr int32_t ScaleShift
void setHasTailCall(const bool HasTC)
void updateRelBlockFreq(uint64_t BlockFreq, uint64_t EntryFreq)
Update RelBlockFreq from BlockFreq and EntryFreq.
static constexpr unsigned RelBlockFreqBits
The value stored in RelBlockFreq has to be interpreted as the digits of a scaled number with a scale ...
Summary of memprof callsite metadata.
SmallVector< unsigned > StackIdIndices
SmallVector< unsigned > Clones
CallsiteInfo(ValueInfo Callee, SmallVector< unsigned > StackIdIndices)
CallsiteInfo(ValueInfo Callee, SmallVector< unsigned > Clones, SmallVector< unsigned > StackIdIndices)
static FunctionSummary::ConstVCall getEmptyKey()
static FunctionSummary::ConstVCall getTombstoneKey()
static unsigned getHashValue(FunctionSummary::ConstVCall I)
static bool isEqual(FunctionSummary::ConstVCall L, FunctionSummary::ConstVCall R)
static FunctionSummary::VFuncId getEmptyKey()
static bool isEqual(FunctionSummary::VFuncId L, FunctionSummary::VFuncId R)
static FunctionSummary::VFuncId getTombstoneKey()
static unsigned getHashValue(FunctionSummary::VFuncId I)
static bool isEqual(ValueInfo L, ValueInfo R)
static ValueInfo getEmptyKey()
static ValueInfo getTombstoneKey()
static bool isSpecialKey(ValueInfo V)
static unsigned getHashValue(ValueInfo I)
An information struct used to provide DenseMap with the various necessary components for a given valu...
A specification for a virtual function call with all constant integer arguments.
std::vector< uint64_t > Args
Flags specific to function summaries.
FFlags & operator&=(const FFlags &RHS)
unsigned ReturnDoesNotAlias
unsigned MustBeUnreachable
Describes the use of a value in a call instruction, specifying the call's target, the value's paramet...
Call(uint64_t ParamNo, ValueInfo Callee, const ConstantRange &Offsets)
Describes the uses of a parameter by the function.
ParamAccess(uint64_t ParamNo, const ConstantRange &Use)
std::vector< Call > Calls
In the per-module summary, it summarizes the byte offset applied to each pointer parameter before pas...
static constexpr uint32_t RangeWidth
All type identifier related information.
std::vector< ConstVCall > TypeCheckedLoadConstVCalls
std::vector< VFuncId > TypeCheckedLoadVCalls
std::vector< ConstVCall > TypeTestAssumeConstVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm....
std::vector< GlobalValue::GUID > TypeTests
List of type identifiers used by this function in llvm.type.test intrinsics referenced by something o...
std::vector< VFuncId > TypeTestAssumeVCalls
List of virtual calls made by this function using (respectively) llvm.assume(llvm....
An "identifier" for a virtual function.
GlobalValueSummaryList SummaryList
List of global value summary structures for a particular value held in the GlobalValueMap.
GlobalValueSummaryInfo(bool HaveGVs)
union llvm::GlobalValueSummaryInfo::NameOrGV U
Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.
GVFlags(GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool NotEligibleToImport, bool Live, bool IsLocal, bool CanAutoHide, ImportKind ImportType)
Convenience Constructors.
unsigned DSOLocal
Indicates that the linker resolved the symbol to a definition from within the same linkage unit.
unsigned CanAutoHide
In the per-module summary, indicates that the global value is linkonce_odr and global unnamed addr (s...
unsigned ImportType
This field is written by the ThinLTO indexing step to postlink combined summary.
unsigned NotEligibleToImport
Indicate if the global value cannot be imported (e.g.
unsigned Linkage
The linkage type of the associated global value.
unsigned Visibility
Indicates the visibility.
unsigned Live
In per-module summary, indicate that the global value must be considered a live root for index-based ...
GVarFlags(bool ReadOnly, bool WriteOnly, bool Constant, GlobalObject::VCallVisibility Vis)
static NodeRef getEntryNode(ModuleSummaryIndex *I)
static NodeRef valueInfoFromEdge(FunctionSummary::EdgeTy &P)
static ChildIteratorType child_begin(NodeRef N)
static ChildEdgeIteratorType child_edge_begin(NodeRef N)
static NodeRef edge_dest(EdgeRef E)
static NodeRef getEntryNode(ValueInfo V)
static ChildIteratorType child_end(NodeRef N)
static ChildEdgeIteratorType child_edge_end(NodeRef N)
FunctionSummary::EdgeTy & EdgeRef
Summary of a single MIB in a memprof metadata on allocations.
MIBInfo(AllocationType AllocType, SmallVector< unsigned > StackIdIndices)
SmallVector< unsigned > StackIdIndices
The following data structures summarize type metadata information.
TypeIdOffsetVtableInfo(uint64_t Offset, ValueInfo VI)
uint64_t AddressPointOffset
std::map< uint64_t, WholeProgramDevirtResolution > WPDRes
Mapping from byte offset to whole-program devirt resolution for that (typeid, byte offset) pair.
Kind
Specifies which kind of type check we should emit for this byte array.
@ Unknown
Unknown (analysis not performed, don't lower)
@ Single
Single element (last example in "Short Inline Bit Vectors")
@ Inline
Inlined bit vector ("Short Inline Bit Vectors")
@ Unsat
Unsatisfiable type (i.e. no global has this type metadata)
@ AllOnes
All-ones bit vector ("Eliminating Bit Vector Checks for All-Ones Bit Vectors")
@ ByteArray
Test a byte array (first example)
unsigned SizeM1BitWidth
Range of size-1 expressed as a bit width.
enum llvm::TypeTestResolution::Kind TheKind
Struct that holds a reference to a particular GUID in a global value summary.
PointerIntPair< const GlobalValueSummaryMapTy::value_type *, 3, int > RefAndFlags
GlobalValue::VisibilityTypes getELFVisibility() const
Returns the most constraining visibility among summaries.
bool isValidAccessSpecifier() const
const GlobalValueSummaryMapTy::value_type * getRef() const
ArrayRef< std::unique_ptr< GlobalValueSummary > > getSummaryList() const
const GlobalValue * getValue() const
ValueInfo(bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R)
bool canAutoHide() const
Checks if all copies are eligible for auto-hiding (have flag set).
unsigned getAccessSpecifier() const
bool isDSOLocal(bool WithDSOLocalPropagation=false) const
Checks if all summaries are DSO local (have the flag set).
GlobalValue::GUID getGUID() const
The ValueInfo and offset for a function within a vtable definition initializer array.
VirtFuncOffset(ValueInfo VI, uint64_t Offset)
@ UniformRetVal
Uniform return value optimization.
@ VirtualConstProp
Virtual constant propagation.
@ UniqueRetVal
Unique return value optimization.
@ Indir
Just do a regular virtual call.
uint64_t Info
Additional information for the resolution:
enum llvm::WholeProgramDevirtResolution::ByArg::Kind TheKind
enum llvm::WholeProgramDevirtResolution::Kind TheKind
std::map< std::vector< uint64_t >, ByArg > ResByArg
Resolutions for calls with all constant integer arguments (excluding the first argument,...
std::string SingleImplName
@ SingleImpl
Single implementation devirtualization.
@ Indir
Just do a regular virtual call.
@ BranchFunnel
When retpoline mitigation is enabled, use a branch funnel that is defined in the merged module.
const GlobalValue * GV
The GlobalValue corresponding to this summary.
StringRef Name
Summary string representation.