[PATCH] D28416: [PGO] Turn off comdat renaming in IR PGO by default

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 14:55:22 PST 2017


xur created this revision.
xur added a reviewer: davidxl.
xur added subscribers: xur, llvm-commits.

In IR PGO we append the function hash to comdat functions to avoid the
potential hash mismatch. This turns out not legal in some cases: if the comdat
function is address-taken and used in comparison. Renaming changes the semantic.

This patch turns off comdat renaming by default.

To alleviate the hash mismatch issue, we now rename the profile variable
for comdat functions. Profile allows co-existing multiple versions of profiles
with different hash value. The inlined copy will always has the correct profile
counter. The out-of-line copy might not have the correct count. But we will
not have the bogus mismatch warning.


https://reviews.llvm.org/D28416

Files:
  include/llvm/ProfileData/InstrProf.h
  lib/ProfileData/InstrProf.cpp
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  test/Transforms/PGOProfile/comdat_internal.ll
  test/Transforms/PGOProfile/comdat_rename.ll
  test/Transforms/PGOProfile/indirect_call_profile.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28416.83438.patch
Type: text/x-patch
Size: 8909 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170106/3e9a782e/attachment.bin>


More information about the llvm-commits mailing list