@@ -93,7 +93,7 @@ extern cl::opt<bool> ScalePartialSampleProfileWorkingSetSize;
93
93
// instruction in it takes an address of any basic block, because instruction
94
94
// can only take an address of basic block located in the same function.
95
95
static bool findRefEdges (ModuleSummaryIndex &Index, const User *CurUser,
96
- SetVector<ValueInfo> &RefEdges,
96
+ SetVector<ValueInfo, std::vector<ValueInfo> > &RefEdges,
97
97
SmallPtrSet<const User *, 8 > &Visited) {
98
98
bool HasBlockAddress = false ;
99
99
SmallVector<const User *, 32 > Worklist;
@@ -144,9 +144,12 @@ static bool isNonRenamableLocal(const GlobalValue &GV) {
144
144
145
145
// / Determine whether this call has all constant integer arguments (excluding
146
146
// / "this") and summarize it to VCalls or ConstVCalls as appropriate.
147
- static void addVCallToSet (DevirtCallSite Call, GlobalValue::GUID Guid,
148
- SetVector<FunctionSummary::VFuncId> &VCalls,
149
- SetVector<FunctionSummary::ConstVCall> &ConstVCalls) {
147
+ static void addVCallToSet (
148
+ DevirtCallSite Call, GlobalValue::GUID Guid,
149
+ SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
150
+ &VCalls,
151
+ SetVector<FunctionSummary::ConstVCall,
152
+ std::vector<FunctionSummary::ConstVCall>> &ConstVCalls) {
150
153
std::vector<uint64_t > Args;
151
154
// Start from the second argument to skip the "this" pointer.
152
155
for (auto &Arg : drop_begin (Call.CB .args ())) {
@@ -163,11 +166,18 @@ static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid,
163
166
// / If this intrinsic call requires that we add information to the function
164
167
// / summary, do so via the non-constant reference arguments.
165
168
static void addIntrinsicToSummary (
166
- const CallInst *CI, SetVector<GlobalValue::GUID> &TypeTests,
167
- SetVector<FunctionSummary::VFuncId> &TypeTestAssumeVCalls,
168
- SetVector<FunctionSummary::VFuncId> &TypeCheckedLoadVCalls,
169
- SetVector<FunctionSummary::ConstVCall> &TypeTestAssumeConstVCalls,
170
- SetVector<FunctionSummary::ConstVCall> &TypeCheckedLoadConstVCalls,
169
+ const CallInst *CI,
170
+ SetVector<GlobalValue::GUID, std::vector<GlobalValue::GUID>> &TypeTests,
171
+ SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
172
+ &TypeTestAssumeVCalls,
173
+ SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
174
+ &TypeCheckedLoadVCalls,
175
+ SetVector<FunctionSummary::ConstVCall,
176
+ std::vector<FunctionSummary::ConstVCall>>
177
+ &TypeTestAssumeConstVCalls,
178
+ SetVector<FunctionSummary::ConstVCall,
179
+ std::vector<FunctionSummary::ConstVCall>>
180
+ &TypeCheckedLoadConstVCalls,
171
181
DominatorTree &DT) {
172
182
switch (CI->getCalledFunction ()->getIntrinsicID ()) {
173
183
case Intrinsic::type_test:
@@ -269,12 +279,14 @@ static void computeFunctionSummary(
269
279
MapVector<ValueInfo, CalleeInfo, DenseMap<ValueInfo, unsigned >,
270
280
std::vector<std::pair<ValueInfo, CalleeInfo>>>
271
281
CallGraphEdges;
272
- SetVector<ValueInfo> RefEdges, LoadRefEdges, StoreRefEdges;
273
- SetVector<GlobalValue::GUID> TypeTests;
274
- SetVector<FunctionSummary::VFuncId> TypeTestAssumeVCalls,
275
- TypeCheckedLoadVCalls;
276
- SetVector<FunctionSummary::ConstVCall> TypeTestAssumeConstVCalls,
277
- TypeCheckedLoadConstVCalls;
282
+ SetVector<ValueInfo, std::vector<ValueInfo>> RefEdges, LoadRefEdges,
283
+ StoreRefEdges;
284
+ SetVector<GlobalValue::GUID, std::vector<GlobalValue::GUID>> TypeTests;
285
+ SetVector<FunctionSummary::VFuncId, std::vector<FunctionSummary::VFuncId>>
286
+ TypeTestAssumeVCalls, TypeCheckedLoadVCalls;
287
+ SetVector<FunctionSummary::ConstVCall,
288
+ std::vector<FunctionSummary::ConstVCall>>
289
+ TypeTestAssumeConstVCalls, TypeCheckedLoadConstVCalls;
278
290
ICallPromotionAnalysis ICallAnalysis;
279
291
SmallPtrSet<const User *, 8 > Visited;
280
292
@@ -505,7 +517,7 @@ static void computeFunctionSummary(
505
517
std::vector<ValueInfo> Refs;
506
518
if (IsThinLTO) {
507
519
auto AddRefEdges = [&](const std::vector<const Instruction *> &Instrs,
508
- SetVector<ValueInfo> &Edges,
520
+ SetVector<ValueInfo, std::vector<ValueInfo> > &Edges,
509
521
SmallPtrSet<const User *, 8 > &Cache) {
510
522
for (const auto *I : Instrs) {
511
523
Cache.erase (I);
@@ -710,7 +722,7 @@ static void computeVariableSummary(ModuleSummaryIndex &Index,
710
722
DenseSet<GlobalValue::GUID> &CantBePromoted,
711
723
const Module &M,
712
724
SmallVectorImpl<MDNode *> &Types) {
713
- SetVector<ValueInfo> RefEdges;
725
+ SetVector<ValueInfo, std::vector<ValueInfo> > RefEdges;
714
726
SmallPtrSet<const User *, 8 > Visited;
715
727
bool HasBlockAddress = findRefEdges (Index, &V, RefEdges, Visited);
716
728
bool NonRenamableLocal = isNonRenamableLocal (V);
0 commit comments