[llvm] [memprof] Teach extractCallsFromIR to look into inline stacks (PR #115441)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 09:33:05 PST 2024


================
@@ -101,4 +101,116 @@ declare !dbg !19 void @_Z2f3v()
   EXPECT_THAT(CallSites[2],
               Pair(FieldsAre(2U, 9U), IndexedMemProfRecord::getGUID("_Z2f3v")));
 }
+
+TEST(MemProf, ExtractDirectCallsFromIRInline) {
+  // The following IR is generated from:
+  //
+  // void f1();
+  // static inline void f2() { f1(); }
+  // static inline void f3() { f2(); }
----------------
snehasish wrote:

If we keep the function on one line then the offset is always zero. Then it's not possible to test if it was unset or actually zero. Can you put some of these on different lines so that we get non-zero offsets?

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


More information about the llvm-commits mailing list