[llvm] [PGO] Instrument modules with at least a single function definition (PR #93421)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 23:06:31 PDT 2024


================
@@ -0,0 +1,5 @@
+; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s --implicit-check-not='__llvm_profile_raw_version'
----------------
minglotus-6 wrote:

While a module that has global variable definitions doesn't create PGO counters, it can provide other information in FDO profiles. 

For instance, dynamic type profiling collects the vtable names in raw FDO profiles (explained in https://discourse.llvm.org/t/rfc-dynamic-type-profiling-and-optimizations-in-llvm/74600).
The RFC is under development but https://github.com/llvm/llvm-project/pull/81442 should be the core change for more efficient indirect-call-promotion.

If the motivation of this change is to speed up instrumentation build (which makes sense), what do you think of a `cl::opt` that allows instrumentation of global variables?

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


More information about the llvm-commits mailing list