]> granicus.if.org Git - clang/commit
[PGO] Avoid instrumenting constants at value sites
authorBetul Buyukkurt <betulb@codeaurora.org>
Thu, 31 Mar 2016 18:41:34 +0000 (18:41 +0000)
committerBetul Buyukkurt <betulb@codeaurora.org>
Thu, 31 Mar 2016 18:41:34 +0000 (18:41 +0000)
commit6e6cdb98bca3d291d3d1450f793a06d3ceb028f8
treeda9aa9771bf6f89b36f762a60c009362d571f9d1
parent142c5b38d4100a34e67da6190a994caf780dd010
[PGO] Avoid instrumenting constants at value sites

Value profiling should not profile constants and/or constant
expressions when they appear as callees in call instructions.
Constant expressions form when a direct callee has bitcasts or
inttoptr(ptrtint (callee)) nests surrounding it. Value profiling
should avoid instrumenting such cases. Mostly NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265037 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPGO.cpp
test/Profile/c-avoid-direct-call.c [new file with mode: 0644]