[PATCH] D135425: [InstrProf] Disable marking COMDAT profd variable as private linkage

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 22:49:59 PDT 2022


xur created this revision.
xur added reviewers: MaskRay, rnk.
Herald added subscribers: Enna1, ellis, StephenFan, wenlei, hiraditya.
Herald added a project: All.
xur requested review of this revision.
Herald added a project: LLVM.

It is not safe to set private linkage for the profd variable created for the COMDAT function.  For the LTO build where the COMDAT group might be dissolved. If that happens, we will have multiple "profd" in the final binary and result in multiple function counters for the same function.

This fixes PR58215: https://github.com/llvm/llvm-project/issues/58215.


https://reviews.llvm.org/D135425

Files:
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/test/Instrumentation/InstrProfiling/comdat.ll
  llvm/test/Instrumentation/InstrProfiling/profiling.ll
  llvm/test/Transforms/PGOProfile/comdat.ll
  llvm/test/Transforms/PGOProfile/indirect_call_profile.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135425.465974.patch
Type: text/x-patch
Size: 6944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221007/523e0de9/attachment.bin>


More information about the llvm-commits mailing list