22
22
#include " lld/Common/ErrorHandler.h"
23
23
#include " llvm/ADT/CachedHashString.h"
24
24
#include " llvm/ADT/DenseMap.h"
25
- #include " llvm/ADT/DenseSet.h"
26
25
#include " llvm/ADT/MapVector.h"
27
26
#include " llvm/ADT/SetVector.h"
28
27
#include " llvm/ADT/SmallSet.h"
36
35
#include " llvm/Support/VirtualFileSystem.h"
37
36
#include < memory>
38
37
#include < optional>
38
+ #include < set>
39
39
40
40
#define DEBUG_TYPE " bp-section-orderer"
41
41
@@ -61,7 +61,7 @@ template <class D> struct BPOrderer {
61
61
bool forDataCompression,
62
62
bool compressionSortStartupFunctions, bool verbose,
63
63
llvm::ArrayRef<Section *> sections,
64
- const DenseMap<CachedHashStringRef, DenseSet <unsigned >>
64
+ const DenseMap<CachedHashStringRef, std::set <unsigned >>
65
65
&rootSymbolToSectionIdxs)
66
66
-> llvm::DenseMap<const Section *, int>;
67
67
@@ -78,7 +78,7 @@ static SmallVector<std::pair<unsigned, UtilityNodes>> getUnsForCompression(
78
78
ArrayRef<const typename D::Section *> sections,
79
79
const DenseMap<const void *, uint64_t > §ionToIdx,
80
80
ArrayRef<unsigned > sectionIdxs,
81
- DenseMap<unsigned , SmallVector<unsigned >> *duplicateSectionIdxs,
81
+ DenseMap<unsigned , SmallVector<unsigned , 0 >> *duplicateSectionIdxs,
82
82
BPFunctionNode::UtilityNodeT &maxUN) {
83
83
TimeTraceScope timeScope (" Build nodes for compression" );
84
84
@@ -162,7 +162,7 @@ auto BPOrderer<D>::computeOrder(
162
162
StringRef profilePath, bool forFunctionCompression, bool forDataCompression,
163
163
bool compressionSortStartupFunctions, bool verbose,
164
164
ArrayRef<Section *> sections,
165
- const DenseMap<CachedHashStringRef, DenseSet <unsigned >>
165
+ const DenseMap<CachedHashStringRef, std::set <unsigned >>
166
166
&rootSymbolToSectionIdxs) -> DenseMap<const Section *, int > {
167
167
TimeTraceScope timeScope (" Setup Balanced Partitioning" );
168
168
DenseMap<const void *, uint64_t > sectionToIdx;
@@ -186,7 +186,7 @@ auto BPOrderer<D>::computeOrder(
186
186
}
187
187
auto &traces = reader->getTemporalProfTraces ();
188
188
189
- DenseMap <unsigned , BPFunctionNode::UtilityNodeT> sectionIdxToFirstUN;
189
+ MapVector <unsigned , BPFunctionNode::UtilityNodeT> sectionIdxToFirstUN;
190
190
for (size_t traceIdx = 0 ; traceIdx < traces.size (); traceIdx++) {
191
191
uint64_t currentSize = 0 , cutoffSize = 1 ;
192
192
size_t cutoffTimestamp = 1 ;
@@ -263,7 +263,7 @@ auto BPOrderer<D>::computeOrder(
263
263
264
264
// Map a section index (order directly) to a list of duplicate section indices
265
265
// (not ordered directly).
266
- DenseMap<unsigned , SmallVector<unsigned >> duplicateSectionIdxs;
266
+ DenseMap<unsigned , SmallVector<unsigned , 0 >> duplicateSectionIdxs;
267
267
auto unsForFunctionCompression = getUnsForCompression<D>(
268
268
sections, sectionToIdx, sectionIdxsForFunctionCompression,
269
269
&duplicateSectionIdxs, maxUN);
0 commit comments