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

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 18 15:07:29 PDT 2024


================
@@ -603,7 +603,10 @@ template <class Edge, class BBInfo> class FuncPGOInstrumentation {
       NumOfPGOMemIntrinsics += ValueSites[IPVK_MemOPSize].size();
       NumOfPGOBB += MST.bbInfoSize();
       ValueSites[IPVK_IndirectCallTarget] = VPC.get(IPVK_IndirectCallTarget);
-      if (EnableVTableValueProfiling)
+      // Collect value sites for 'pgo-instr-use' pass if `icp-max-num-vtables`
+      // is not zero.
+      if (EnableVTableValueProfiling ||
+          (!CreateGlobalVar && MaxNumVTableAnnotations != 0))
----------------
minglotus-6 wrote:

Sorry I only realized https://github.com/llvm/llvm-project/pull/99402/commits/36b85b825fa67ec7b4cb3c9a71382fa9e99341fe would cause benign warnings when profile is generated in `enable-vtable-value-profiling=false`.

I updated the PR to conditionally compute the vtable value sites and annotate profiles iff function profile record has vtable value profiles.

Regarding rollout, it'd make sense to keep `enable-vtable-value-profiling` consistent in instrumentation and optimized build.

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


More information about the llvm-commits mailing list