Skip to content

Revert "[StaticDataLayout][PGO]Implement reader and writer change for data access profiles" #141157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mingmingl-llvm
Copy link
Contributor

Reverts #139997

Sanitizer failures (https://lab.llvm.org/buildbot/#/builders/94/builds/7373)

Will fix forward later.

@llvmbot llvmbot added the PGO Profile Guided Optimizations label May 22, 2025
@mingmingl-llvm mingmingl-llvm merged commit d0acddb into main May 22, 2025
8 of 12 checks passed
@mingmingl-llvm mingmingl-llvm deleted the revert-139997-users/mingmingl-llvm/instr-prof-reader-writer branch May 22, 2025 23:14
@llvmbot
Copy link
Member

llvmbot commented May 22, 2025

@llvm/pr-subscribers-pgo

Author: Mingming Liu (mingmingl-llvm)

Changes

Reverts llvm/llvm-project#139997

Sanitizer failures (https://lab.llvm.org/buildbot/#/builders/94/builds/7373)

Will fix forward later.


Patch is 28.97 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/141157.diff

14 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/DataAccessProf.h (+8-14)
  • (modified) llvm/include/llvm/ProfileData/IndexedMemProfData.h (+3-9)
  • (modified) llvm/include/llvm/ProfileData/InstrProfReader.h (+1-5)
  • (modified) llvm/include/llvm/ProfileData/InstrProfWriter.h (-6)
  • (modified) llvm/include/llvm/ProfileData/MemProfReader.h (-14)
  • (modified) llvm/include/llvm/ProfileData/MemProfYAML.h (-61)
  • (modified) llvm/lib/ProfileData/DataAccessProf.cpp (+3-4)
  • (modified) llvm/lib/ProfileData/IndexedMemProfData.cpp (+12-50)
  • (modified) llvm/lib/ProfileData/InstrProfReader.cpp (-14)
  • (modified) llvm/lib/ProfileData/InstrProfWriter.cpp (+2-11)
  • (modified) llvm/lib/ProfileData/MemProfReader.cpp (-29)
  • (modified) llvm/test/tools/llvm-profdata/memprof-yaml.test (+1-90)
  • (modified) llvm/tools/llvm-profdata/llvm-profdata.cpp (-4)
  • (modified) llvm/unittests/ProfileData/DataAccessProfTest.cpp (+2-2)
diff --git a/llvm/include/llvm/ProfileData/DataAccessProf.h b/llvm/include/llvm/ProfileData/DataAccessProf.h
index cd4b200486a3f..3cc8835a776dd 100644
--- a/llvm/include/llvm/ProfileData/DataAccessProf.h
+++ b/llvm/include/llvm/ProfileData/DataAccessProf.h
@@ -17,8 +17,10 @@
 #ifndef LLVM_PROFILEDATA_DATAACCESSPROF_H_
 #define LLVM_PROFILEDATA_DATAACCESSPROF_H_
 
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfoVariant.h"
 #include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
@@ -33,15 +35,12 @@
 
 namespace llvm {
 
-namespace memprof {
+namespace data_access_prof {
 
 /// The location of data in the source code. Used by profile lookup API.
 struct SourceLocation {
   SourceLocation(StringRef FileNameRef, uint32_t Line)
       : FileName(FileNameRef.str()), Line(Line) {}
-
-  // Empty constructor is used in yaml conversion.
-  SourceLocation() {}
   /// The filename where the data is located.
   std::string FileName;
   /// The line number in the source code.
@@ -54,8 +53,6 @@ namespace internal {
 // which strings are owned by `DataAccessProfData`. Used by `DataAccessProfData`
 // to represent data locations internally.
 struct SourceLocationRef {
-  SourceLocationRef(StringRef FileNameRef, uint32_t Line)
-      : FileName(FileNameRef), Line(Line) {}
   // The filename where the data is located.
   StringRef FileName;
   // The line number in the source code.
@@ -103,21 +100,18 @@ using SymbolHandle = std::variant<std::string, uint64_t>;
 /// The data access profiles for a symbol.
 struct DataAccessProfRecord {
 public:
-  DataAccessProfRecord(SymbolHandleRef SymHandleRef, uint64_t AccessCount,
-                       ArrayRef<internal::SourceLocationRef> LocRefs)
-      : AccessCount(AccessCount) {
+  DataAccessProfRecord(SymbolHandleRef SymHandleRef,
+                       ArrayRef<internal::SourceLocationRef> LocRefs) {
     if (std::holds_alternative<StringRef>(SymHandleRef)) {
       SymHandle = std::get<StringRef>(SymHandleRef).str();
     } else
       SymHandle = std::get<uint64_t>(SymHandleRef);
 
     for (auto Loc : LocRefs)
-      Locations.emplace_back(Loc.FileName, Loc.Line);
+      Locations.push_back(SourceLocation(Loc.FileName, Loc.Line));
   }
-  // Empty constructor is used in yaml conversion.
-  DataAccessProfRecord() {}
   SymbolHandle SymHandle;
-  uint64_t AccessCount;
+
   // The locations of data in the source code. Optional.
   SmallVector<SourceLocation> Locations;
 };
@@ -214,7 +208,7 @@ class DataAccessProfData {
   llvm::SetVector<StringRef> KnownColdSymbols;
 };
 
-} // namespace memprof
+} // namespace data_access_prof
 } // namespace llvm
 
 #endif // LLVM_PROFILEDATA_DATAACCESSPROF_H_
diff --git a/llvm/include/llvm/ProfileData/IndexedMemProfData.h b/llvm/include/llvm/ProfileData/IndexedMemProfData.h
index 2b40094a9bc21..f33b160e0b6a9 100644
--- a/llvm/include/llvm/ProfileData/IndexedMemProfData.h
+++ b/llvm/include/llvm/ProfileData/IndexedMemProfData.h
@@ -15,13 +15,9 @@
 #ifndef LLVM_PROFILEDATA_INDEXEDMEMPROFDATA_H
 #define LLVM_PROFILEDATA_INDEXEDMEMPROFDATA_H
 
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/MemProf.h"
 
-#include <functional>
-#include <optional>
-
 namespace llvm {
 namespace memprof {
 struct IndexedMemProfData {
@@ -86,10 +82,8 @@ struct IndexedMemProfData {
 } // namespace memprof
 
 // Write the MemProf data to OS.
-Error writeMemProf(
-    ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
-    memprof::IndexedVersion MemProfVersionRequested, bool MemProfFullSchema,
-    std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData);
-
+Error writeMemProf(ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
+                   memprof::IndexedVersion MemProfVersionRequested,
+                   bool MemProfFullSchema);
 } // namespace llvm
 #endif
diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h
index d104ab51430d1..c250a9ede39bc 100644
--- a/llvm/include/llvm/ProfileData/InstrProfReader.h
+++ b/llvm/include/llvm/ProfileData/InstrProfReader.h
@@ -18,7 +18,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/Object/BuildID.h"
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/InstrProfCorrelator.h"
 #include "llvm/ProfileData/MemProf.h"
@@ -704,13 +703,10 @@ class IndexedMemProfReader {
   const unsigned char *CallStackBase = nullptr;
   // The number of elements in the radix tree array.
   unsigned RadixTreeSize = 0;
-  /// The data access profiles, deserialized from binary data.
-  std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData;
 
   Error deserializeV2(const unsigned char *Start, const unsigned char *Ptr);
   Error deserializeRadixTreeBased(const unsigned char *Start,
-                                  const unsigned char *Ptr,
-                                  memprof::IndexedVersion Version);
+                                  const unsigned char *Ptr);
 
 public:
   IndexedMemProfReader() = default;
diff --git a/llvm/include/llvm/ProfileData/InstrProfWriter.h b/llvm/include/llvm/ProfileData/InstrProfWriter.h
index cdb7afb623378..b72c901dbb5b2 100644
--- a/llvm/include/llvm/ProfileData/InstrProfWriter.h
+++ b/llvm/include/llvm/ProfileData/InstrProfWriter.h
@@ -19,7 +19,6 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/Object/BuildID.h"
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/IndexedMemProfData.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/Support/Error.h"
@@ -82,8 +81,6 @@ class InstrProfWriter {
   // Whether to generated random memprof hotness for testing.
   bool MemprofGenerateRandomHotness;
 
-  std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData;
-
 public:
   // For memprof testing, random hotness can be assigned to the contexts if
   // MemprofGenerateRandomHotness is enabled. The random seed can be either
@@ -125,9 +122,6 @@ class InstrProfWriter {
   // Add a binary id to the binary ids list.
   void addBinaryIds(ArrayRef<llvm::object::BuildID> BIs);
 
-  void addDataAccessProfData(
-      std::unique_ptr<memprof::DataAccessProfData> DataAccessProfile);
-
   /// Merge existing function counts from the given writer.
   void mergeRecordsFromWriter(InstrProfWriter &&IPW,
                               function_ref<void(Error)> Warn);
diff --git a/llvm/include/llvm/ProfileData/MemProfReader.h b/llvm/include/llvm/ProfileData/MemProfReader.h
index 3bfcdf0f42cde..130493ec77c08 100644
--- a/llvm/include/llvm/ProfileData/MemProfReader.h
+++ b/llvm/include/llvm/ProfileData/MemProfReader.h
@@ -229,20 +229,6 @@ class YAMLMemProfReader final : public MemProfReader {
   create(std::unique_ptr<MemoryBuffer> Buffer);
 
   void parse(StringRef YAMLData);
-
-  std::unique_ptr<memprof::DataAccessProfData> takeDataAccessProfData() {
-    return std::move(DataAccessProfileData);
-  }
-
-private:
-  // Called by `parse` to set data access profiles after parsing them from Yaml
-  // files.
-  void
-  setDataAccessProfileData(std::unique_ptr<memprof::DataAccessProfData> Data) {
-    DataAccessProfileData = std::move(Data);
-  }
-
-  std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData;
 };
 } // namespace memprof
 } // namespace llvm
diff --git a/llvm/include/llvm/ProfileData/MemProfYAML.h b/llvm/include/llvm/ProfileData/MemProfYAML.h
index f8dc659f66662..b642e3098aa0e 100644
--- a/llvm/include/llvm/ProfileData/MemProfYAML.h
+++ b/llvm/include/llvm/ProfileData/MemProfYAML.h
@@ -2,7 +2,6 @@
 #define LLVM_PROFILEDATA_MEMPROFYAML_H_
 
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/MemProf.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/YAMLTraits.h"
@@ -21,24 +20,9 @@ struct GUIDMemProfRecordPair {
   MemProfRecord Record;
 };
 
-// Helper struct to yamlify memprof::DataAccessProfData. The struct
-// members use owned strings. This is for simplicity and assumes that most real
-// world use cases do look-ups and regression test scale is small.
-struct YamlDataAccessProfData {
-  std::vector<memprof::DataAccessProfRecord> Records;
-  std::vector<uint64_t> KnownColdStrHashes;
-  std::vector<std::string> KnownColdSymbols;
-
-  bool isEmpty() const {
-    return Records.empty() && KnownColdStrHashes.empty() &&
-           KnownColdSymbols.empty();
-  }
-};
-
 // The top-level data structure, only used with YAML for now.
 struct AllMemProfData {
   std::vector<GUIDMemProfRecordPair> HeapProfileRecords;
-  YamlDataAccessProfData YamlifiedDataAccessProfiles;
 };
 } // namespace memprof
 
@@ -222,52 +206,9 @@ template <> struct MappingTraits<memprof::GUIDMemProfRecordPair> {
   }
 };
 
-template <> struct MappingTraits<memprof::SourceLocation> {
-  static void mapping(IO &Io, memprof::SourceLocation &Loc) {
-    Io.mapOptional("FileName", Loc.FileName);
-    Io.mapOptional("Line", Loc.Line);
-  }
-};
-
-template <> struct MappingTraits<memprof::DataAccessProfRecord> {
-  static void mapping(IO &Io, memprof::DataAccessProfRecord &Rec) {
-    if (Io.outputting()) {
-      if (std::holds_alternative<std::string>(Rec.SymHandle)) {
-        Io.mapOptional("Symbol", std::get<std::string>(Rec.SymHandle));
-      } else {
-        Io.mapOptional("Hash", std::get<uint64_t>(Rec.SymHandle));
-      }
-    } else {
-      std::string SymName;
-      uint64_t Hash = 0;
-      Io.mapOptional("Symbol", SymName);
-      Io.mapOptional("Hash", Hash);
-      if (!SymName.empty()) {
-        Rec.SymHandle = SymName;
-      } else {
-        Rec.SymHandle = Hash;
-      }
-    }
-
-    Io.mapOptional("Locations", Rec.Locations);
-  }
-};
-
-template <> struct MappingTraits<memprof::YamlDataAccessProfData> {
-  static void mapping(IO &Io, memprof::YamlDataAccessProfData &Data) {
-    Io.mapOptional("SampledRecords", Data.Records);
-    Io.mapOptional("KnownColdSymbols", Data.KnownColdSymbols);
-    Io.mapOptional("KnownColdStrHashes", Data.KnownColdStrHashes);
-  }
-};
-
 template <> struct MappingTraits<memprof::AllMemProfData> {
   static void mapping(IO &Io, memprof::AllMemProfData &Data) {
     Io.mapRequired("HeapProfileRecords", Data.HeapProfileRecords);
-    // Map data access profiles if reading input, or if writing output &&
-    // the struct is populated.
-    if (!Io.outputting() || !Data.YamlifiedDataAccessProfiles.isEmpty())
-      Io.mapOptional("DataAccessProfiles", Data.YamlifiedDataAccessProfiles);
   }
 };
 
@@ -293,7 +234,5 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::AllocationInfo)
 LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::CallSiteInfo)
 LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::GUIDMemProfRecordPair)
 LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::GUIDHex64) // Used for CalleeGuids
-LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::DataAccessProfRecord)
-LLVM_YAML_IS_SEQUENCE_VECTOR(memprof::SourceLocation)
 
 #endif // LLVM_PROFILEDATA_MEMPROFYAML_H_
diff --git a/llvm/lib/ProfileData/DataAccessProf.cpp b/llvm/lib/ProfileData/DataAccessProf.cpp
index 090dcb3dcc1b9..a31f3db0621fb 100644
--- a/llvm/lib/ProfileData/DataAccessProf.cpp
+++ b/llvm/lib/ProfileData/DataAccessProf.cpp
@@ -11,7 +11,7 @@
 #include <sys/types.h>
 
 namespace llvm {
-namespace memprof {
+namespace data_access_prof {
 
 // If `Map` has an entry keyed by `Str`, returns the entry iterator. Otherwise,
 // creates an owned copy of `Str`, adds a map entry for it and returns the
@@ -48,8 +48,7 @@ DataAccessProfData::getProfileRecord(const SymbolHandleRef SymbolID) const {
 
   auto It = Records.find(Key);
   if (It != Records.end()) {
-    return DataAccessProfRecord(Key, It->second.AccessCount,
-                                It->second.Locations);
+    return DataAccessProfRecord(Key, It->second.Locations);
   }
 
   return std::nullopt;
@@ -262,5 +261,5 @@ Error DataAccessProfData::deserializeRecords(const unsigned char *&Ptr) {
   }
   return Error::success();
 }
-} // namespace memprof
+} // namespace data_access_prof
 } // namespace llvm
diff --git a/llvm/lib/ProfileData/IndexedMemProfData.cpp b/llvm/lib/ProfileData/IndexedMemProfData.cpp
index 7398e4c468bbe..59e59720179af 100644
--- a/llvm/lib/ProfileData/IndexedMemProfData.cpp
+++ b/llvm/lib/ProfileData/IndexedMemProfData.cpp
@@ -10,7 +10,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/InstrProfReader.h"
 #include "llvm/ProfileData/MemProf.h"
@@ -218,9 +217,7 @@ static Error writeMemProfV2(ProfOStream &OS,
 
 static Error writeMemProfRadixTreeBased(
     ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
-    memprof::IndexedVersion Version, bool MemProfFullSchema,
-    std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData =
-        nullptr) {
+    memprof::IndexedVersion Version, bool MemProfFullSchema) {
   assert((Version == memprof::Version3 || Version == memprof::Version4) &&
          "Unsupported version for radix tree format");
 
@@ -229,8 +226,6 @@ static Error writeMemProfRadixTreeBased(
   OS.write(0ULL); // Reserve space for the memprof call stack payload offset.
   OS.write(0ULL); // Reserve space for the memprof record payload offset.
   OS.write(0ULL); // Reserve space for the memprof record table offset.
-  if (Version >= memprof::Version4)
-    OS.write(0ULL); // Reserve space for the data access profile offset.
 
   auto Schema = memprof::getHotColdSchema();
   if (MemProfFullSchema)
@@ -257,29 +252,17 @@ static Error writeMemProfRadixTreeBased(
   uint64_t RecordTableOffset = writeMemProfRecords(
       OS, MemProfData.Records, &Schema, Version, &MemProfCallStackIndexes);
 
-  uint64_t DataAccessProfOffset = 0;
-  if (DataAccessProfileData != nullptr) {
-    assert(Version >= memprof::Version4 &&
-           "Data access profiles are added starting from v4");
-    DataAccessProfOffset = OS.tell();
-    if (Error E = DataAccessProfileData->serialize(OS))
-      return E;
-  }
-
   // Verify that the computation for the number of elements in the call stack
   // array works.
   assert(CallStackPayloadOffset +
              NumElements * sizeof(memprof::LinearFrameId) ==
          RecordPayloadOffset);
 
-  SmallVector<uint64_t, 4> Header = {
+  uint64_t Header[] = {
       CallStackPayloadOffset,
       RecordPayloadOffset,
       RecordTableOffset,
   };
-  if (Version >= memprof::Version4)
-    Header.push_back(DataAccessProfOffset);
-
   OS.patch({{HeaderUpdatePos, Header}});
 
   return Error::success();
@@ -294,28 +277,24 @@ static Error writeMemProfV3(ProfOStream &OS,
 }
 
 // Write out MemProf Version4
-static Error writeMemProfV4(
-    ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
-    bool MemProfFullSchema,
-    std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData) {
+static Error writeMemProfV4(ProfOStream &OS,
+                            memprof::IndexedMemProfData &MemProfData,
+                            bool MemProfFullSchema) {
   return writeMemProfRadixTreeBased(OS, MemProfData, memprof::Version4,
-                                    MemProfFullSchema,
-                                    std::move(DataAccessProfileData));
+                                    MemProfFullSchema);
 }
 
 // Write out the MemProf data in a requested version.
-Error writeMemProf(
-    ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
-    memprof::IndexedVersion MemProfVersionRequested, bool MemProfFullSchema,
-    std::unique_ptr<memprof::DataAccessProfData> DataAccessProfileData) {
+Error writeMemProf(ProfOStream &OS, memprof::IndexedMemProfData &MemProfData,
+                   memprof::IndexedVersion MemProfVersionRequested,
+                   bool MemProfFullSchema) {
   switch (MemProfVersionRequested) {
   case memprof::Version2:
     return writeMemProfV2(OS, MemProfData, MemProfFullSchema);
   case memprof::Version3:
     return writeMemProfV3(OS, MemProfData, MemProfFullSchema);
   case memprof::Version4:
-    return writeMemProfV4(OS, MemProfData, MemProfFullSchema,
-                          std::move(DataAccessProfileData));
+    return writeMemProfV4(OS, MemProfData, MemProfFullSchema);
   }
 
   return make_error<InstrProfError>(
@@ -379,10 +358,7 @@ Error IndexedMemProfReader::deserializeV2(const unsigned char *Start,
 }
 
 Error IndexedMemProfReader::deserializeRadixTreeBased(
-    const unsigned char *Start, const unsigned char *Ptr,
-    memprof::IndexedVersion Version) {
-  assert((Version == memprof::Version3 || Version == memprof::Version4) &&
-         "Unsupported version for radix tree format");
+    const unsigned char *Start, const unsigned char *Ptr) {
   // The offset in the stream right before invoking
   // CallStackTableGenerator.Emit.
   const uint64_t CallStackPayloadOffset =
@@ -394,11 +370,6 @@ Error IndexedMemProfReader::deserializeRadixTreeBased(
   const uint64_t RecordTableOffset =
       support::endian::readNext<uint64_t, llvm::endianness::little>(Ptr);
 
-  uint64_t DataAccessProfOffset = 0;
-  if (Version == memprof::Version4)
-    DataAccessProfOffset =
-        support::endian::readNext<uint64_t, llvm::endianness::little>(Ptr);
-
   // Read the schema.
   auto SchemaOr = memprof::readMemProfSchema(Ptr);
   if (!SchemaOr)
@@ -420,15 +391,6 @@ Error IndexedMemProfReader::deserializeRadixTreeBased(
       /*Payload=*/Start + RecordPayloadOffset,
       /*Base=*/Start, memprof::RecordLookupTrait(Version, Schema)));
 
-  assert((!DataAccessProfOffset || DataAccessProfOffset > RecordTableOffset) &&
-         "Data access profile is either empty or after the record table");
-  if (DataAccessProfOffset > RecordTableOffset) {
-    DataAccessProfileData = std::make_unique<memprof::DataAccessProfData>();
-    const unsigned char *DAPPtr = Start + DataAccessProfOffset;
-    if (Error E = DataAccessProfileData->deserialize(DAPPtr))
-      return E;
-  }
-
   return Error::success();
 }
 
@@ -462,7 +424,7 @@ Error IndexedMemProfReader::deserialize(const unsigned char *Start,
   case memprof::Version3:
   case memprof::Version4:
     // V3 and V4 share the same high-level structure (radix tree, linear IDs).
-    if (Error E = deserializeRadixTreeBased(Start, Ptr, Version))
+    if (Error E = deserializeRadixTreeBased(Start, Ptr))
       return E;
     break;
   }
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index ab109cd5b13a7..a1eb08362087f 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -1552,20 +1552,6 @@ memprof::AllMemProfData IndexedMemProfReader::getAllMemProfData() const {
     Pair.Record = std::move(*Record);
     AllMemProfData.HeapProfileRecords.push_back(std::move(Pair));
   }
-  // Populate the data access profiles for yaml output.
-  if (DataAccessProfileData != nullptr) {
-    for (const auto &[SymHandleRef, RecordRef] :
-         DataAccessProfileData->getRecords())
-      AllMemProfData.YamlifiedDataAccessProfiles.Records.push_back(
-          memprof::DataAccessProfRecord(SymHandleRef, RecordRef.AccessCount,
-                                        RecordRef.Locations));
-    for (StringRef ColdSymbol : DataAccessProfileData->getKnownColdSymbols())
-      AllMemProfData.YamlifiedDataAccessProfiles.KnownColdSymbols.push_back(
-          ColdSymbol.str());
-    for (uint64_t Hash : DataAccessProfileData->getKnownColdHashes())
-      AllMemProfData.YamlifiedDataAccessProfiles.KnownColdStrHashes.push_back(
-          Hash);
-  }
   return AllMemProfData;
 }
 
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 039e1bc955cd4..2c6640eedebd9 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -16,7 +16,6 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/ProfileSummary.h"
-#include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/IndexedMemProfData.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/ProfileCommon.h"
@@ -321,11 +320,6 @@ void InstrProfWriter::addBinaryIds(ArrayRef<llvm::object::BuildID> BIs) {
   llvm::appe...
[truncated]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants