summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-04-27 21:17:30 +0000
committerRong Xu <xur@google.com>2016-04-27 21:17:30 +0000
commitaf5aebaa3246a404644a66d4b8e5844ead30aef8 (patch)
tree73ea7fa36ccb7ce4e2e71bacdb29eedfefb02fe6 /llvm/lib
parent0547b016b18631db0f20855a509986650a3b4487 (diff)
downloadbcm5719-llvm-af5aebaa3246a404644a66d4b8e5844ead30aef8.tar.gz
bcm5719-llvm-af5aebaa3246a404644a66d4b8e5844ead30aef8.zip
[PGO] Prohibit address recording if the function is both internal and COMDAT
Differential Revision: http://reviews.llvm.org/D19515 llvm-svn: 267792
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index b1f8a4ac70d..397e64b410e 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -237,6 +237,11 @@ static inline bool shouldRecordFunctionAddr(Function *F) {
if (!F->hasLinkOnceLinkage() && !F->hasLocalLinkage() &&
!F->hasAvailableExternallyLinkage())
return true;
+ // Prohibit function address recording if the function is both internal and
+ // COMDAT. This avoids the profile data variable referencing internal symbols
+ // in COMDAT.
+ if (F->hasLocalLinkage() && F->hasComdat())
+ return false;
// Check uses of this function for other than direct calls or invokes to it.
return F->hasAddressTaken();
}
OpenPOWER on IntegriCloud