aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/InstrProfWriter.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-31 15:29:44 -0700
committerGitHub <noreply@github.com>2024-05-31 15:29:44 -0700
commitbba5ee47e63298d61f6ea441a140144ce370ba92 (patch)
treeed9c085b51288c2dd7cc5c4ab635820df3a461af /llvm/lib/ProfileData/InstrProfWriter.cpp
parenta585446110d06ba12ea8151044f3ac97f98faf92 (diff)
downloadllvm-bba5ee47e63298d61f6ea441a140144ce370ba92.zip
llvm-bba5ee47e63298d61f6ea441a140144ce370ba92.tar.gz
llvm-bba5ee47e63298d61f6ea441a140144ce370ba92.tar.bz2
[memprof] Introduce memprof::LinearFrameId (NFC) (#94057)
This patch introduces memprof::LinearFrameId, which is a frame version of memprof::LinearCallStackId.
Diffstat (limited to 'llvm/lib/ProfileData/InstrProfWriter.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProfWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 9b12922..e58e6b8 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -491,11 +491,12 @@ static uint64_t writeMemProfFrames(
// Serialize MemProfFrameData. Return the mapping from FrameIds to their
// indexes within the frame array.
-static llvm::DenseMap<memprof::FrameId, uint32_t> writeMemProfFrameArray(
+static llvm::DenseMap<memprof::FrameId, memprof::LinearFrameId>
+writeMemProfFrameArray(
ProfOStream &OS,
llvm::MapVector<memprof::FrameId, memprof::Frame> &MemProfFrameData) {
// Mappings from FrameIds to array indexes.
- llvm::DenseMap<memprof::FrameId, uint32_t> MemProfFrameIndexes;
+ llvm::DenseMap<memprof::FrameId, memprof::LinearFrameId> MemProfFrameIndexes;
// Sort the FrameIDs for stability.
std::vector<std::pair<memprof::FrameId, const memprof::Frame *>> FrameIdOrder;
@@ -541,7 +542,8 @@ writeMemProfCallStackArray(
ProfOStream &OS,
llvm::MapVector<memprof::CallStackId, llvm::SmallVector<memprof::FrameId>>
&MemProfCallStackData,
- llvm::DenseMap<memprof::FrameId, uint32_t> &MemProfFrameIndexes) {
+ llvm::DenseMap<memprof::FrameId, memprof::LinearFrameId>
+ &MemProfFrameIndexes) {
llvm::DenseMap<memprof::CallStackId, memprof::LinearCallStackId>
MemProfCallStackIndexes;
@@ -710,7 +712,7 @@ static Error writeMemProfV3(ProfOStream &OS,
Schema = memprof::getFullSchema();
writeMemProfSchema(OS, Schema);
- llvm::DenseMap<memprof::FrameId, uint32_t> MemProfFrameIndexes =
+ llvm::DenseMap<memprof::FrameId, memprof::LinearFrameId> MemProfFrameIndexes =
writeMemProfFrameArray(OS, MemProfData.FrameData);
uint64_t CallStackPayloadOffset = OS.tell();