[PATCH] D32688: [Coverage] Comdat section name should be same as the variable name in COFF format

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 09:02:51 PDT 2017


On Tue, May 2, 2017 at 8:57 AM, Reid Kleckner via Phabricator <
reviews at reviews.llvm.org> wrote:

> rnk added a comment.
>
> I suspect that the appropriate fix is to give the __profd variables
> internal linkage, not to change the comdat name. The linker will still
> discard duplicate profc and profd sections with this change.
>
> Actually, I'm surprised that the profiling data isn't comdat associated
> with the function itself. Is it possible for instrprofiling to be different
> across different TUs, or to link PGO instrumented code with non-PGO
> instrumented code? If that's the case, we probably want to make all
> profiling metadata associated with the function itself.
>


It was comdat associated with the function before -- but it was wrong. The
problem is that different comdat functions may have different CFGs (due to
different early inlining), leading to incompatible profile counter data.
Note that a comdat function can be later inlined, so using a shared copy of
profile counter will be bad (out of bound access, not to mention profile
use phase can not use it).

David



>
>
> https://reviews.llvm.org/D32688
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170502/e84c798b/attachment.html>


More information about the llvm-commits mailing list