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

Pavel Samolysov via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 00:45:28 PDT 2024


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

@minglotus-6 Thank you for the comment. Maybe I've chosen wrong wording for the title and some description. The patch doesn't disable any instrumentation indeed, it just disables the variable `__llvm_profile_raw_version` generation when nothing has actually been instrumented in the module. The test just demonstrates the current behavior. When a solution to instrument global variables is landed, the `__llvm_profile_raw_version` variable will be generated and the test will ought to be rewritten. This will make some issues when already split thin-LTO modules is put under post-link instrumentation though, but this is unrelated to the PR. Actually my intent is to open a door for instrumentation during the post-link phase, when the modules have already been split. When the `__llvm_profile_raw_version` variable presents twice in the same even thought split module, it makes a problem with a duplicated symbol for the linker.

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


More information about the llvm-commits mailing list