Skip to content

[memprof] Remove dead code in MemProfReader (NFC) #117607

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions llvm/include/llvm/ProfileData/MemProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
22 changes: 0 additions & 22 deletions llvm/lib/ProfileData/MemProfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading