[PATCH] D98061: [InstrProfiling] Generate runtime hook for ELF platforms

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 14:57:44 PST 2021


vsk added a subscriber: ributzka.
vsk added a comment.

@ributzka may have stronger thoughts about when -fprofile-instr-generate must imply that a known set of symbols appear with external visibility. Up until now, the answer has been "always", and this is what tapi enforces for MachO. It's awkward to have this be inconsistent between MachO/ELF, but if there's a compelling performance reason then I think it's fine.



================
Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:1082-1084
   auto *User = Function::Create(FunctionType::get(Int32Ty, false),
                                 GlobalValue::LinkOnceODRLinkage,
                                 getInstrProfRuntimeHookVarUseFuncName(), M);
----------------
phosek wrote:
> @vsk do you know why we need this function instead of just using `llvm.compiler.used`/`llvm.used` for the symbol? I used that approach for ELF and it seems to be working fine.
I don't have the context for this, since this code is from before I started working on llvm. I'm guessing, but maybe it's possible that llvm(.compiler)?.used didn't exist or work well when this code was written.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98061



More information about the llvm-commits mailing list