[llvm] fec57e5 - Revert "[llvm-profgen] Clean up unnecessary memory reservations between phases."

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 14:45:09 PST 2022


Author: Hongtao Yu
Date: 2022-02-01T14:44:48-08:00
New Revision: fec57e5b172d5ad6b532b33a7af3b6a80dddf695

URL: https://github.com/llvm/llvm-project/commit/fec57e5b172d5ad6b532b33a7af3b6a80dddf695
DIFF: https://github.com/llvm/llvm-project/commit/fec57e5b172d5ad6b532b33a7af3b6a80dddf695.diff

LOG: Revert "[llvm-profgen] Clean up unnecessary memory reservations between phases."

This reverts commit 057e784b0962a7c5a17e858932bb6f03c7676c47.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index 98b4c7cdf169a..46422ce470898 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -1212,7 +1212,6 @@ void PerfScriptReader::parsePerfTraces() {
   warnTruncatedStack();
   warnInvalidRange();
   generateUnsymbolizedProfile();
-  AggregatedSamples.clear();
 
   if (SkipSymbolization)
     writeUnsymbolizedProfile(OutputFilename);

diff  --git a/llvm/tools/llvm-profgen/llvm-profgen.cpp b/llvm/tools/llvm-profgen/llvm-profgen.cpp
index b2728ae41872a..f092df04d52b3 100644
--- a/llvm/tools/llvm-profgen/llvm-profgen.cpp
+++ b/llvm/tools/llvm-profgen/llvm-profgen.cpp
@@ -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;


        


More information about the llvm-commits mailing list