[llvm] b0ca543 - [memprof] Remove dead code in MemProfReader (NFC) (#117607)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 25 11:01:29 PST 2024
Author: Kazu Hirata
Date: 2024-11-25T11:01:26-08:00
New Revision: b0ca543532d13fde8907853f6c9909ad7e68cd9f
URL: https://github.com/llvm/llvm-project/commit/b0ca543532d13fde8907853f6c9909ad7e68cd9f
DIFF: https://github.com/llvm/llvm-project/commit/b0ca543532d13fde8907853f6c9909ad7e68cd9f.diff
LOG: [memprof] Remove dead code in MemProfReader (NFC) (#117607)
The only constructor in current use is the one that takes
IndexedMemProfData. Likewise, the only accessor in current use is
takeMemProfData.
Added:
Modified:
llvm/include/llvm/ProfileData/MemProfReader.h
llvm/lib/ProfileData/MemProfReader.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ProfileData/MemProfReader.h b/llvm/include/llvm/ProfileData/MemProfReader.h
index 57ddcbf350060c..caf404d95d8659 100644
--- a/llvm/include/llvm/ProfileData/MemProfReader.h
+++ b/llvm/include/llvm/ProfileData/MemProfReader.h
@@ -46,26 +46,6 @@ class MemProfReader {
return Iterator(this);
}
- // Return a const reference to the internal Id to Frame mappings.
- LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
- const llvm::DenseMap<FrameId, Frame> &getFrameMapping() const {
- return IdToFrame;
- }
-
- // Return a const reference to the internal Id to call stacks.
- LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
- const llvm::DenseMap<CallStackId, llvm::SmallVector<FrameId>> &
- getCallStacks() const {
- return CSIdToCallStack;
- }
-
- // Return a const reference to the internal function profile data.
- LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
- const llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> &
- getProfileData() const {
- return FunctionProfileData;
- }
-
// Take the complete profile data.
IndexedMemProfData takeMemProfData() {
// TODO: Once we replace the three member variables, namely IdToFrame,
@@ -116,24 +96,6 @@ class MemProfReader {
MemProfReader() = default;
virtual ~MemProfReader() = default;
- // Initialize the MemProfReader with the frame mappings and profile contents.
- LLVM_DEPRECATED("Construct MemProfReader with IndexedMemProfData",
- "MemProfReader")
- MemProfReader(
- llvm::DenseMap<FrameId, Frame> FrameIdMap,
- llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData);
-
- // Initialize the MemProfReader with the frame mappings, call stack mappings,
- // and profile contents.
- LLVM_DEPRECATED("Construct MemProfReader with IndexedMemProfData",
- "MemProfReader")
- MemProfReader(
- llvm::DenseMap<FrameId, Frame> FrameIdMap,
- llvm::DenseMap<CallStackId, llvm::SmallVector<FrameId>> CSIdMap,
- llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData)
- : IdToFrame(std::move(FrameIdMap)), CSIdToCallStack(std::move(CSIdMap)),
- FunctionProfileData(std::move(ProfData)) {}
-
// Initialize the MemProfReader with the given MemProf profile.
MemProfReader(IndexedMemProfData MemProfData) {
for (const auto &[FrameId, F] : MemProfData.Frames)
diff --git a/llvm/lib/ProfileData/MemProfReader.cpp b/llvm/lib/ProfileData/MemProfReader.cpp
index 7f88b318f6f18f..6c5cf823fb9e06 100644
--- a/llvm/lib/ProfileData/MemProfReader.cpp
+++ b/llvm/lib/ProfileData/MemProfReader.cpp
@@ -228,28 +228,6 @@ std::string getBuildIdString(const SegmentEntry &Entry) {
}
} // namespace
-MemProfReader::MemProfReader(
- llvm::DenseMap<FrameId, Frame> FrameIdMap,
- llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData)
- : IdToFrame(std::move(FrameIdMap)),
- FunctionProfileData(std::move(ProfData)) {
- // Populate CSId in each IndexedAllocationInfo and IndexedMemProfRecord
- // while storing CallStack in CSIdToCallStack.
- for (auto &KV : FunctionProfileData) {
- IndexedMemProfRecord &Record = KV.second;
- for (auto &AS : Record.AllocSites) {
- CallStackId CSId = hashCallStack(AS.CallStack);
- AS.CSId = CSId;
- CSIdToCallStack.insert({CSId, AS.CallStack});
- }
- for (auto &CS : Record.CallSites) {
- CallStackId CSId = hashCallStack(CS);
- Record.CallSiteIds.push_back(CSId);
- CSIdToCallStack.insert({CSId, CS});
- }
- }
-}
-
Expected<std::unique_ptr<RawMemProfReader>>
RawMemProfReader::create(const Twine &Path, const StringRef ProfiledBinary,
bool KeepName) {
More information about the llvm-commits
mailing list