summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/InstrProfiling
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-07-26 22:59:17 +0000
committerReid Kleckner <rnk@google.com>2018-07-26 22:59:17 +0000
commitc6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef (patch)
treeac85d3e79cb58e4caf241f03155a65eccd639bc0 /llvm/test/Instrumentation/InstrProfiling
parent9ea65082ff5a5fe187608783641d57afe8fcf18e (diff)
downloadbcm5719-llvm-c6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef.tar.gz
bcm5719-llvm-c6cf918f448bd3ba1f8f0feff9f97a1fc4e3b7ef.zip
[InstrProf] Use comdats on COFF for available_externally functions
Summary: r262157 added ELF-specific logic to put a comdat on the __profc_* globals created for available_externally functions. We should be able to generalize that logic to all object file formats that support comdats, i.e. everything other than MachO. This fixes duplicate symbol errors, since on COFF, linkonce_odr doesn't make the symbol weak. Fixes PR38251. Reviewers: davidxl, xur Subscribers: hiraditya, dmajor, llvm-commits, aheejin Differential Revision: https://reviews.llvm.org/D49882 llvm-svn: 338082
Diffstat (limited to 'llvm/test/Instrumentation/InstrProfiling')
-rw-r--r--llvm/test/Instrumentation/InstrProfiling/linkage.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/InstrProfiling/linkage.ll b/llvm/test/Instrumentation/InstrProfiling/linkage.ll
index c3682834d5c..6cbc88f3451 100644
--- a/llvm/test/Instrumentation/InstrProfiling/linkage.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/linkage.ll
@@ -32,6 +32,8 @@ define weak void @foo_weak() {
; COMMON: @"__profc_linkage.ll:foo_internal" = internal global
; COMMON: @"__profd_linkage.ll:foo_internal" = internal global
+; COFF: @"__profc_linkage.ll:foo_internal" = internal global
+; COFF: @"__profd_linkage.ll:foo_internal" = internal global
define internal void @foo_internal() {
call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"__profn_linkage.ll:foo_internal", i32 0, i32 0), i64 0, i32 1, i32 0)
ret void
@@ -39,6 +41,9 @@ define internal void @foo_internal() {
; COMMON: @__profc_foo_inline = linkonce_odr hidden global
; COMMON: @__profd_foo_inline = linkonce_odr hidden global
+; FIXME: Should we put a comdat here?
+; COFF: @__profc_foo_inline = linkonce_odr hidden global {{.*}}section ".lprfc", align 8
+; COFF: @__profd_foo_inline = linkonce_odr hidden global {{.*}}section ".lprfd", align 8
define linkonce_odr void @foo_inline() {
call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
ret void
@@ -48,6 +53,8 @@ define linkonce_odr void @foo_inline() {
; LINUX: @__profd_foo_extern = linkonce_odr hidden global {{.*}}section "__llvm_prf_data", comdat($__profv_foo_extern), align 8
; OTHER: @__profc_foo_extern = linkonce_odr hidden global
; OTHER: @__profd_foo_extern = linkonce_odr hidden global
+; COFF: @__profc_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfc", comdat, align 8
+; COFF: @__profd_foo_extern = linkonce_odr hidden global {{.*}}section ".lprfd", comdat($__profc_foo_extern), align 8
define available_externally void @foo_extern() {
call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
ret void
OpenPOWER on IntegriCloud