[llvm] [memprof] Add extractCallsFromIR (PR #115218)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 14:50:30 PST 2024


================
@@ -795,6 +795,53 @@ struct AllocMatchInfo {
   bool Matched = false;
 };
 
+DenseMap<uint64_t, SmallVector<CallEdgeTy, 0>>
+memprof::extractCallsFromIR(Module &M) {
+  DenseMap<uint64_t, SmallVector<CallEdgeTy, 0>> Calls;
+
+  auto GetOffset = [](const DILocation *DIL) {
+    return (DIL->getLine() - DIL->getScope()->getSubprogram()->getLine()) &
----------------
snehasish wrote:

Should we assert that getLine() (for the call and the function start) are non-zero?

https://github.com/llvm/llvm-project/pull/115218


More information about the llvm-commits mailing list