[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
Mon Jul 22 10:57:03 PDT 2024


================
@@ -109,6 +109,25 @@
 // ICTEXT: {{.*}}instrprof-vtable-value-prof.cpp;_ZTVN12_GLOBAL__N_18Derived2E:750
 // ICTEXT: _ZTV8Derived1:250
 
+// When vtable value profiles exist, pgo-instr-use pass should annotate them
+// even if `-enable-vtable-value-profiling` is not explicitly on.
+// RUN: %clangxx -m64 -fprofile-use=test.profdata -fuse-ld=lld -O2 \
+// RUN:   -mllvm -print-after=pgo-instr-use -mllvm -filter-print-funcs=main \
+// RUN:   -mllvm -print-module-scope %s 2>&1 | FileCheck %s --check-prefix=ANNOTATE
+
+// ANNOTATE-NOT: Inconsistent number of value sites
+// ANNOTATE: !{!"VP", i32 2
+
+// When vtable value profiles exist, pgo-instr-use pass will not annotate them
+// if `-max-num-vtable-annotaitons` is set to zero.
----------------
minglotus-6 wrote:

ah this is because the option variable name is `MaxNumVTableAnnotations` but its registered string is `icp-max-num-vtables`.

https://github.com/llvm/llvm-project/blob/bee2654300a8f524e05dd4cad41411d597246ac0/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp#L48-L50

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


More information about the llvm-commits mailing list