]> granicus.if.org Git - llvm/commitdiff
[ThinLTO] Use DenseSet instead of SmallPtrSet for holding GUIDs
authorTeresa Johnson <tejohnson@google.com>
Thu, 5 Jan 2017 14:59:56 +0000 (14:59 +0000)
committerTeresa Johnson <tejohnson@google.com>
Thu, 5 Jan 2017 14:59:56 +0000 (14:59 +0000)
Should fix some more bot failures from r291108.
This should have been a DenseSet, since GUID is not a pointer type.
It caused some bots to fail, but for some reason I wasnt't getting a
build failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291115 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ModuleSummaryAnalysis.cpp

index 28546912b6bfadf98dd485449e767d756bdfd1d4..058a601c7f3b9427a6e7cc81a06ccc1baa83ebb7 100644 (file)
@@ -88,7 +88,7 @@ static void
 computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
                        const Function &F, BlockFrequencyInfo *BFI,
                        ProfileSummaryInfo *PSI, bool HasLocalsInUsed,
-                       SmallPtrSet<GlobalValue::GUID, 8> &CantBePromoted) {
+                       DenseSet<GlobalValue::GUID> &CantBePromoted) {
   // Summary not currently supported for anonymous functions, they should
   // have been named.
   assert(F.hasName());
@@ -200,7 +200,7 @@ computeFunctionSummary(ModuleSummaryIndex &Index, const Module &M,
 
 static void
 computeVariableSummary(ModuleSummaryIndex &Index, const GlobalVariable &V,
-                       SmallPtrSet<GlobalValue::GUID, 8> &CantBePromoted) {
+                       DenseSet<GlobalValue::GUID> &CantBePromoted) {
   SetVector<ValueInfo> RefEdges;
   SmallPtrSet<const User *, 8> Visited;
   findRefEdges(&V, RefEdges, Visited);
@@ -215,7 +215,7 @@ computeVariableSummary(ModuleSummaryIndex &Index, const GlobalVariable &V,
 
 static void
 computeAliasSummary(ModuleSummaryIndex &Index, const GlobalAlias &A,
-                    SmallPtrSet<GlobalValue::GUID, 8> &CantBePromoted) {
+                    DenseSet<GlobalValue::GUID> &CantBePromoted) {
   bool NonRenamableLocal = isNonRenamableLocal(A);
   GlobalValueSummary::GVFlags Flags(A.getLinkage(), NonRenamableLocal);
   auto AS = llvm::make_unique<AliasSummary>(Flags, ArrayRef<ValueInfo>{});
@@ -245,7 +245,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
   collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ false);
   // Next collect those in the llvm.compiler.used set.
   collectUsedGlobalVariables(M, Used, /*CompilerUsed*/ true);
-  SmallPtrSet<GlobalValue::GUID, 8> CantBePromoted;
+  DenseSet<GlobalValue::GUID> CantBePromoted;
   for (auto *V : Used) {
     if (V->hasLocalLinkage()) {
       LocalsUsed.insert(V);