r355044 - [InstrProf] Use separate comdat group for data and counters

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 15:38:44 PST 2019


Author: rnk
Date: Wed Feb 27 15:38:44 2019
New Revision: 355044

URL: http://llvm.org/viewvc/llvm-project?rev=355044&view=rev
Log:
[InstrProf] Use separate comdat group for data and counters

Summary:
I hadn't realized that instrumentation runs before inlining, so we can't
use the function as the comdat group. Doing so can create relocations
against discarded sections when references to discarded __profc_
variables are inlined into functions outside the function's comdat
group.

In the future, perhaps we should consider standardizing the comdat group
names that ELF and COFF use. It will save object file size, since
__profv_$sym won't appear in the symbol table again.

Reviewers: xur, vsk

Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D58737

Modified:
    cfe/trunk/test/Profile/cxx-templates.cpp

Modified: cfe/trunk/test/Profile/cxx-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/cxx-templates.cpp?rev=355044&r1=355043&r2=355044&view=diff
==============================================================================
--- cfe/trunk/test/Profile/cxx-templates.cpp (original)
+++ cfe/trunk/test/Profile/cxx-templates.cpp Wed Feb 27 15:38:44 2019
@@ -10,8 +10,8 @@
 // RUN: FileCheck --input-file=%tuse -check-prefix=T0USE -check-prefix=ALL %s
 // RUN: FileCheck --input-file=%tuse -check-prefix=T100USE -check-prefix=ALL %s
 
-// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = {{(linkonce_odr hidden|internal)}} global [2 x i64] zeroinitializer
-// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = {{(linkonce_odr hidden|internal)}} global [2 x i64] zeroinitializer
+// T0GEN: @[[T0C:__profc__Z4loopILj0EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer
+// T100GEN: @[[T100C:__profc__Z4loopILj100EEvv]] = linkonce_odr {{(hidden|dso_local)}} global [2 x i64] zeroinitializer
 
 // T0GEN-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()
 // T0USE-LABEL: define linkonce_odr {{.*}}void @_Z4loopILj0EEvv()




More information about the cfe-commits mailing list