[llvm] [memprof] Improve a comment (NFC) (PR #142002)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 11:10:33 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/142002

We can go one step further than "compare" and mention "prefix" to
succinctly describe the function.


>From 3bcb6bb47a4ae98dbac6e64a011ea85b96eb7c3d Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 29 May 2025 11:04:10 -0700
Subject: [PATCH] [memprof] Improve a comment (NFC)

We can go one step further than "compare" and mention "prefix" to
succinctly describe the function.
---
 llvm/lib/Transforms/Instrumentation/MemProfiler.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
index deb9f8999eab7..c88feac16d7ac 100644
--- a/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
@@ -762,9 +762,9 @@ static AllocationType addCallStack(CallStackTrie &AllocTrie,
   return AllocType;
 }
 
-// Helper to compare the InlinedCallStack computed from an instruction's debug
-// info to a list of Frames from profile data (either the allocation data or a
-// callsite).
+// Return true if InlinedCallStack, computed from a call instruction's debug
+// info, is a prefix of ProfileCallStack, a list of Frames from profile data
+// (either the allocation data or a callsite).
 static bool
 stackFrameIncludesInlinedCallStack(ArrayRef<Frame> ProfileCallStack,
                                    ArrayRef<uint64_t> InlinedCallStack) {



More information about the llvm-commits mailing list