diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp index 98b4c7cdf169..46422ce47089 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 b2728ae41872..f092df04d52b 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;