Skip to content

[memprof] Remove extraneous memprof:: (NFC) #94825

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
20 changes: 9 additions & 11 deletions llvm/include/llvm/ProfileData/MemProf.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ struct IndexedMemProfRecord {
// on the schema provided in \p Schema.
void serialize(const MemProfSchema &Schema, raw_ostream &OS,
IndexedVersion Version,
llvm::DenseMap<memprof::CallStackId, LinearCallStackId>
llvm::DenseMap<CallStackId, LinearCallStackId>
*MemProfCallStackIndexes = nullptr) const;

// Deserializes memprof records from the Buffer.
Expand Down Expand Up @@ -579,15 +579,14 @@ class RecordWriterTrait {
IndexedVersion Version;

// Mappings from CallStackId to the indexes into the call stack array.
llvm::DenseMap<memprof::CallStackId, LinearCallStackId>
*MemProfCallStackIndexes;
llvm::DenseMap<CallStackId, LinearCallStackId> *MemProfCallStackIndexes;

public:
// We do not support the default constructor, which does not set Version.
RecordWriterTrait() = delete;
RecordWriterTrait(const MemProfSchema *Schema, IndexedVersion V,
llvm::DenseMap<memprof::CallStackId, LinearCallStackId>
*MemProfCallStackIndexes)
RecordWriterTrait(
const MemProfSchema *Schema, IndexedVersion V,
llvm::DenseMap<CallStackId, LinearCallStackId> *MemProfCallStackIndexes)
: Schema(Schema), Version(V),
MemProfCallStackIndexes(MemProfCallStackIndexes) {}

Expand Down Expand Up @@ -1039,11 +1038,10 @@ class CallStackRadixTreeBuilder {
CallStackRadixTreeBuilder() = default;

// Build a radix tree array.
void
build(llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>>
&&MemProfCallStackData,
const llvm::DenseMap<FrameId, LinearFrameId> &MemProfFrameIndexes,
llvm::DenseMap<memprof::FrameId, memprof::FrameStat> &FrameHistogram);
void build(llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>>
&&MemProfCallStackData,
const llvm::DenseMap<FrameId, LinearFrameId> &MemProfFrameIndexes,
llvm::DenseMap<FrameId, FrameStat> &FrameHistogram);

const std::vector<LinearFrameId> &getRadixArray() const { return RadixArray; }

Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/MemProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class MemProfReader {
Callback =
std::bind(&MemProfReader::idToFrame, this, std::placeholders::_1);

memprof::CallStackIdConverter<decltype(CSIdToCallStack)> CSIdConv(
CSIdToCallStack, Callback);
CallStackIdConverter<decltype(CSIdToCallStack)> CSIdConv(CSIdToCallStack,
Callback);

const IndexedMemProfRecord &IndexedRecord = Iter->second;
GuidRecord = {
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/ProfileData/MemProf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,15 @@ MemProfRecord IndexedMemProfRecord::toMemProfRecord(
MemProfRecord Record;

Record.AllocSites.reserve(AllocSites.size());
for (const memprof::IndexedAllocationInfo &IndexedAI : AllocSites) {
memprof::AllocationInfo AI;
for (const IndexedAllocationInfo &IndexedAI : AllocSites) {
AllocationInfo AI;
AI.Info = IndexedAI.Info;
AI.CallStack = Callback(IndexedAI.CSId);
Record.AllocSites.push_back(std::move(AI));
}

Record.CallSites.reserve(CallSiteIds.size());
for (memprof::CallStackId CSId : CallSiteIds)
for (CallStackId CSId : CallSiteIds)
Record.CallSites.push_back(Callback(CSId));

return Record;
Expand Down Expand Up @@ -487,7 +487,7 @@ void CallStackRadixTreeBuilder::build(
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>>
&&MemProfCallStackData,
const llvm::DenseMap<FrameId, LinearFrameId> &MemProfFrameIndexes,
llvm::DenseMap<memprof::FrameId, memprof::FrameStat> &FrameHistogram) {
llvm::DenseMap<FrameId, FrameStat> &FrameHistogram) {
// Take the vector portion of MemProfCallStackData. The vector is exactly
// what we need to sort. Also, we no longer need its lookup capability.
llvm::SmallVector<CSIdPair, 0> CallStacks = MemProfCallStackData.takeVector();
Expand Down
Loading