[PATCH] D114383: [InstrProfiling] Add -runtime-counter-relocation=function mode

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 22:52:37 PST 2021


phosek added a comment.

An alternative I thought of would be to always use a call and generate a (weak) implementation of `__llvm_profile_counter_dynamic_bias` inside each translation unit. The default generated function would simply return the variable. I'm not sure what the impact on performance would be though.



================
Comment at: compiler-rt/include/profile/InstrProfData.inc:668
 #define INSTR_PROF_PROFILE_COUNTER_BIAS_VAR __llvm_profile_counter_bias
+#define INSTR_PROF_PROFILE_COUNTER_DYNAMIC_BIAS_FUNC __llvm_profile_counter_dynamic_bias
 
----------------
It's not clear to me from this name that it refers to a function that returns the bias. How about `__llvm_profile_get_counter_bias`? That would match symbols like `__llvm_profile_get_magic` or `__llvm_profile_get_version`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114383/new/

https://reviews.llvm.org/D114383



More information about the llvm-commits mailing list