[PATCH] D48203: [SanitizerCoverage] Add associated metadata to pc-tables.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 15 10:30:30 PDT 2018


eugenis added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:409
     appendToUsed(M, GlobalsToAppendToUsed);
+    appendToCompilerUsed(M, GlobalsToAppendToCompilerUsed);
+  }
----------------
morehouse wrote:
> eugenis wrote:
> > morehouse wrote:
> > > eugenis wrote:
> > > > this is unnecessary, llvm.used is strictly stronger than llvm.compiler.used
> > > I'm not sure I understand...  We're appending different things to each list.
> > Right. Sorry.
> > A different question then: why only MachO?
> Kostya mentioned his reasoning in http://lists.llvm.org/pipermail/llvm-dev/2017-September/117315.html.
I don't understand that thread :(
What I know is, without compiler.used, neither comdat nor !associated nor a named section would save pctable from the optimizer. Try passing this through opt -O3:

$a = comdat any
@a = global i32 0, align 4, comdat($a)
@b = internal global i32 0, align 4, section "abc", !associated !0, comdat($a)
; @llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32* @b to i8*)]
!0 = !{i32 *@a}



https://reviews.llvm.org/D48203





More information about the llvm-commits mailing list