Revert "[llvm-profgen] Clean up unnecessary memory reservations between phases."
authorHongtao Yu <hoy@fb.com>
Tue, 1 Feb 2022 22:44:37 +0000 (14:44 -0800)
committerHongtao Yu <hoy@fb.com>
Tue, 1 Feb 2022 22:44:48 +0000 (14:44 -0800)
This reverts commit 057e784b0962a7c5a17e858932bb6f03c7676c47.

llvm/tools/llvm-profgen/PerfReader.cpp
llvm/tools/llvm-profgen/llvm-profgen.cpp

index 98b4c7c..46422ce 100644 (file)
@@ -1212,7 +1212,6 @@ void PerfScriptReader::parsePerfTraces() {
   warnTruncatedStack();
   warnInvalidRange();
   generateUnsymbolizedProfile();
-  AggregatedSamples.clear();
 
   if (SkipSymbolization)
     writeUnsymbolizedProfile(OutputFilename);
index b2728ae..f092df0 100644 (file)
@@ -158,9 +158,6 @@ int main(int argc, const char *argv[]) {
       ProfileGeneratorBase::create(Binary.get(), Reader->getSampleCounters(),
                                    Reader->profileIsCSFlat());
   Generator->generateProfile();
-  // The Reader object, espcially its SampleCounters field, is not needed at
-  // this point, so releasing it to reduce peak memory usage.
-  Reader.release();
   Generator->write();
 
   return EXIT_SUCCESS;