[compiler-rt] [llvm] [InstrPGO][TypeProf]Annotate vtable types when they are present in the profile (PR #99402)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 10:04:05 PDT 2024


================
@@ -1755,8 +1757,18 @@ void PGOUseFunc::annotateValueSites() {
 void PGOUseFunc::annotateValueSites(uint32_t Kind) {
   assert(Kind <= IPVK_Last);
   unsigned ValueSiteIndex = 0;
-  auto &ValueSites = FuncInfo.ValueSites[Kind];
   unsigned NumValueSites = ProfileRecord.getNumValueSites(Kind);
+  // FuncPGOInstrumentation ctor finds value sites for each kind. It runs on the
+  // common path of pgo-instr-gen and pgo-instr-use, and vtable kind path
+  // is gated by `-enable-vtable-value-profiling`. If vtable profiles are
+  // present, not explicitly discarded and vtable sites remain empty, try to
+  // find the sites again.
----------------
teresajohnson wrote:

Why can't this just always be done here: https://github.com/llvm/llvm-project/blob/d06b55e7934635049d55efff2dc9e745f911240c/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L606-L607 ?

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


More information about the llvm-commits mailing list