From fec57e5b172d5ad6b532b33a7af3b6a80dddf695 Mon Sep 17 00:00:00 2001 From: Hongtao Yu Date: Tue, 1 Feb 2022 14:44:37 -0800 Subject: [PATCH] Revert "[llvm-profgen] Clean up unnecessary memory reservations between phases." This reverts commit 057e784b0962a7c5a17e858932bb6f03c7676c47. --- llvm/tools/llvm-profgen/PerfReader.cpp | 1 - llvm/tools/llvm-profgen/llvm-profgen.cpp | 3 --- 2 files changed, 4 deletions(-) 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;