[llvm] [ProfileData] Remove toCompress and setToCompress from ProfileSymbolList (NFC) (PR #216236)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 20:19:40 PDT 2026


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/216236

This patch removes toCompress, setToCompress, and ToCompress in
ProfileSymbolList.  Nobody calls setToCompress, so ToCompress is
always false.


>From 9b91a1e6e48011b38e755decfaa2397a513c42c7 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 13 Aug 2026 18:38:37 -0700
Subject: [PATCH] [ProfileData] Remove toCompress and setToCompress from
 ProfileSymbolList (NFC)

This patch removes toCompress, setToCompress, and ToCompress in
ProfileSymbolList.  Nobody calls setToCompress, so ToCompress is
always false.
---
 llvm/include/llvm/ProfileData/SampleProf.h | 7 -------
 llvm/lib/ProfileData/SampleProfWriter.cpp  | 2 --
 2 files changed, 9 deletions(-)

diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index f2dd11f86cf01..f439b704d897a 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -1704,9 +1704,6 @@ class ProfileSymbolList {
   unsigned size() const { return IsMD5 ? ColdGUIDTable.size() : Syms.size(); }
   void reserve(size_t Size) { Syms.reserve(Size); }
 
-  void setToCompress(bool TC) { ToCompress = TC; }
-  bool toCompress() { return ToCompress; }
-
   std::vector<uint64_t> collectGUIDs() const {
     assert(!IsMD5 &&
            "Collecting GUIDs from existing MD5 table not yet implemented");
@@ -1736,10 +1733,6 @@ class ProfileSymbolList {
 
 private:
   bool IsMD5 = false;
-  // Determine whether or not to compress the symbol list when
-  // writing it into profile. The variable is unused when the symbol
-  // list is read from an existing profile.
-  bool ToCompress = false;
   DenseSet<StringRef> Syms;
   EytzingerTableSpan<support::ulittle64_t> ColdGUIDTable;
   BumpPtrAllocator Allocator;
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
index 9cb9bf5af9f6a..c8fb9b56802f7 100644
--- a/llvm/lib/ProfileData/SampleProfWriter.cpp
+++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
@@ -646,8 +646,6 @@ std::error_code SampleProfileWriterExtBinaryBase::writeOneSection(
   SecHdrTableEntry &Entry = SectionHdrLayout[LayoutIdx];
 
   // The setting of SecFlagCompress should happen before markSectionStart.
-  if (Type == SecProfileSymbolList && ProfSymList && ProfSymList->toCompress())
-    setToCompressSection(SecProfileSymbolList);
   if (Type == SecFuncMetadata && FunctionSamples::ProfileIsProbeBased)
     addSectionFlag(SecFuncMetadata, SecFuncMetadataFlags::SecFlagIsProbeBased);
   if (Type == SecFuncMetadata &&



More information about the llvm-commits mailing list