[llvm-branch-commits] [llvm] [compiler-rt] [ThinLTO][TypeProf] Implement vtable def import (PR #79381)

Teresa Johnson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 25 11:57:19 PST 2024


================
@@ -124,6 +124,28 @@ static bool findRefEdges(ModuleSummaryIndex &Index, const User *CurUser,
         Worklist.push_back(Operand);
     }
   }
+
+  const Instruction *I = dyn_cast<Instruction>(CurUser);
+  if (I) {
+    uint32_t ActualNumValueData = 0;
+    uint64_t TotalCount = 0;
+    // 24 is the maximum number of values preserved for one instrumented site,
+    // defined by INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE in
+    // compiler-rt/lib/profile/InstrProfilingValue.c; passing 24 as
+    // `MaxNumValueData` controls the max number of elements in the returned
+    // array. The actual number of values is gated by the number of ops in !prof
+    // metadata.
+    auto ValueDataArray = getValueProfDataFromInst(
+        *I, IPVK_VTableTarget, 24 /* MaxNumValueData */, ActualNumValueData,
----------------
teresajohnson wrote:

Do we really want 24? Or should we limit to something smaller (and tunable), like we do for virtual function pointer profiles in ICP.

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


More information about the llvm-branch-commits mailing list