From 3d83912c0c7be63d24e54792b300f394931a363b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 25 Jul 2023 10:21:58 +0100 Subject: Revert rGfae7b98c221b5b28797f7b56b656b6b819d99f27 "[Support] Change SetVector's default template parameter to SmallVector<*, 0>" This is failing on Windows MSVC builds: llvm\unittests\Support\ThreadPool.cpp(380): error C2440: 'return': cannot convert from 'Vector' to 'std::vector>' with [ Vector=llvm::SmallVector ] --- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 46 +++++++++++------------------ 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp') diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 775bb95..2076ed4 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -93,7 +93,7 @@ extern cl::opt ScalePartialSampleProfileWorkingSetSize; // instruction in it takes an address of any basic block, because instruction // can only take an address of basic block located in the same function. static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser, - SetVector> &RefEdges, + SetVector &RefEdges, SmallPtrSet &Visited) { bool HasBlockAddress = false; SmallVector Worklist; @@ -144,12 +144,9 @@ static bool isNonRenamableLocal(const GlobalValue &GV) { /// Determine whether this call has all constant integer arguments (excluding /// "this") and summarize it to VCalls or ConstVCalls as appropriate. -static void addVCallToSet( - DevirtCallSite Call, GlobalValue::GUID Guid, - SetVector> - &VCalls, - SetVector> &ConstVCalls) { +static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid, + SetVector &VCalls, + SetVector &ConstVCalls) { std::vector Args; // Start from the second argument to skip the "this" pointer. for (auto &Arg : drop_begin(Call.CB.args())) { @@ -166,18 +163,11 @@ static void addVCallToSet( /// If this intrinsic call requires that we add information to the function /// summary, do so via the non-constant reference arguments. static void addIntrinsicToSummary( - const CallInst *CI, - SetVector> &TypeTests, - SetVector> - &TypeTestAssumeVCalls, - SetVector> - &TypeCheckedLoadVCalls, - SetVector> - &TypeTestAssumeConstVCalls, - SetVector> - &TypeCheckedLoadConstVCalls, + const CallInst *CI, SetVector &TypeTests, + SetVector &TypeTestAssumeVCalls, + SetVector &TypeCheckedLoadVCalls, + SetVector &TypeTestAssumeConstVCalls, + SetVector &TypeCheckedLoadConstVCalls, DominatorTree &DT) { switch (CI->getCalledFunction()->getIntrinsicID()) { case Intrinsic::type_test: @@ -279,14 +269,12 @@ static void computeFunctionSummary( MapVector, std::vector>> CallGraphEdges; - SetVector> RefEdges, LoadRefEdges, - StoreRefEdges; - SetVector> TypeTests; - SetVector> - TypeTestAssumeVCalls, TypeCheckedLoadVCalls; - SetVector> - TypeTestAssumeConstVCalls, TypeCheckedLoadConstVCalls; + SetVector RefEdges, LoadRefEdges, StoreRefEdges; + SetVector TypeTests; + SetVector TypeTestAssumeVCalls, + TypeCheckedLoadVCalls; + SetVector TypeTestAssumeConstVCalls, + TypeCheckedLoadConstVCalls; ICallPromotionAnalysis ICallAnalysis; SmallPtrSet Visited; @@ -517,7 +505,7 @@ static void computeFunctionSummary( std::vector Refs; if (IsThinLTO) { auto AddRefEdges = [&](const std::vector &Instrs, - SetVector> &Edges, + SetVector &Edges, SmallPtrSet &Cache) { for (const auto *I : Instrs) { Cache.erase(I); @@ -722,7 +710,7 @@ static void computeVariableSummary(ModuleSummaryIndex &Index, DenseSet &CantBePromoted, const Module &M, SmallVectorImpl &Types) { - SetVector> RefEdges; + SetVector RefEdges; SmallPtrSet Visited; bool HasBlockAddress = findRefEdges(Index, &V, RefEdges, Visited); bool NonRenamableLocal = isNonRenamableLocal(V); -- cgit v1.1