]> granicus.if.org Git - llvm/commitdiff
Bitcode: Do not remove empty summary entries when reading a per-module summary.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 28 Apr 2017 17:41:43 +0000 (17:41 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 28 Apr 2017 17:41:43 +0000 (17:41 +0000)
This became no longer necessary after D19462 landed, and will be incompatible
with an upcoming change to the summary data structures that changes how we
represent references.

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

include/llvm/IR/ModuleSummaryIndex.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/IR/ModuleSummaryIndex.cpp

index 9c0a4159cad2fea76614d58d26d9a7a72d359266..d80f8640b599000062aa2b36cc52f8d98d1fd202 100644 (file)
@@ -703,13 +703,6 @@ public:
     return &I->second;
   }
 
-  /// Remove entries in the GlobalValueMap that have empty summaries due to the
-  /// eager nature of map entry creation during VST parsing. These would
-  /// also be suppressed during combined index generation in mergeFrom(),
-  /// but if there was only one module or this was the first module we might
-  /// not invoke mergeFrom.
-  void removeEmptySummaryEntries();
-
   /// Collect for the given module the list of function it defines
   /// (GUID -> Summary).
   void collectDefinedFunctionsForModule(StringRef ModulePath,
index 6d727ce8334695cd055954169e475db82ffd9f19..6b29f6d66a18ea19d196dfa5a68c74f12c87c27f 100644 (file)
@@ -4985,16 +4985,6 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(
     case BitstreamEntry::Error:
       return error("Malformed block");
     case BitstreamEntry::EndBlock:
-      // For a per-module index, remove any entries that still have empty
-      // summaries. The VST parsing creates entries eagerly for all symbols,
-      // but not all have associated summaries (e.g. it doesn't know how to
-      // distinguish between VST_CODE_ENTRY for function declarations vs global
-      // variables with initializers that end up with a summary). Remove those
-      // entries now so that we don't need to rely on the combined index merger
-      // to clean them up (especially since that may not run for the first
-      // module's index if we merge into that).
-      if (!Combined)
-        TheIndex.removeEmptySummaryEntries();
       return Error::success();
     case BitstreamEntry::Record:
       // The interesting case.
index 9072f4bc7b121bb93e8bad9655679ce4b38f3ba2..8d1d67976dce348464bded0da297e64cda0e8b70 100644 (file)
@@ -52,18 +52,6 @@ void ModuleSummaryIndex::mergeFrom(std::unique_ptr<ModuleSummaryIndex> Other,
   }
 }
 
-void ModuleSummaryIndex::removeEmptySummaryEntries() {
-  for (auto MI = begin(), MIE = end(); MI != MIE;) {
-    // Only expect this to be called on a per-module index, which has a single
-    // entry per value entry list.
-    assert(MI->second.size() == 1);
-    if (!MI->second[0])
-      MI = GlobalValueMap.erase(MI);
-    else
-      ++MI;
-  }
-}
-
 // Collect for the given module the list of function it defines
 // (GUID -> Summary).
 void ModuleSummaryIndex::collectDefinedFunctionsForModule(