aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2021-08-10 11:03:07 -0700
committerPetr Hosek <phosek@google.com>2021-08-10 23:21:15 -0700
commit389dc94d4be7a75c243528981a25260c1c7a6103 (patch)
tree4334423371777ea597c767c53ef367b0657cfcdc /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentc0c1c3cf93ec089887944027ebfa95da03f8040b (diff)
downloadllvm-389dc94d4be7a75c243528981a25260c1c7a6103.zip
llvm-389dc94d4be7a75c243528981a25260c1c7a6103.tar.gz
llvm-389dc94d4be7a75c243528981a25260c1c7a6103.tar.bz2
[InstrProfiling] Generate runtime hook for Fuchsia
When none of the translation units in the binary have been instrumented we shouldn't need to link the profile runtime. However, because we pass -u__llvm_profile_runtime on Linux and Fuchsia, the runtime would still be pulled in and incur some overhead. On Fuchsia which uses runtime counter relocation, it also means that we cannot reference the bias variable unconditionally. This change modifies the InstrProfiling pass to pull in the profile runtime only when needed by declaring the __llvm_profile_runtime symbol in the translation unit only when needed. For now we restrict this only for Fuchsia, but this can be later expanded to other platforms. This approach was already used prior to 9a041a75221ca, but we changed it to always generate the __llvm_profile_runtime due to a TAPI limitation, but that limitation may no longer apply, and it certainly doesn't apply on platforms like Fuchsia. Differential Revision: https://reviews.llvm.org/D98061
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions