[PATCH] D22613: [Profile] deprecate __llvm_profile_override_default_filename (part-1)

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 10:55:05 PDT 2016


On Thu, Jul 21, 2016 at 10:52 AM, Vedant Kumar <vsk at apple.com> wrote:

> vsk added a comment.
>
> Nice, just one concern.
>
>
> ================
> Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:615
> @@ +614,3 @@
> +      ProfileNameVar->setComdat(M->getOrInsertComdat(
> +          StringRef(INSTR_PROF_QUOTE(INSTR_PROF_PROFILE_NAME_VAR))));
> +  }
> ----------------
> What's the advantage of placing the file name var in a comdat if it
> already has weak linkage? Would some ELF tests break without this?
>
>
It won't break, but the final binary will contain more than one copies of
the symbols which wastes space. With Comdat, there is only one copy in the
final link. Note current behavior (with private linkage will also result in
multiple copies which is fixed here).

David



>
> https://reviews.llvm.org/D22613
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/7dce69a9/attachment.html>


More information about the llvm-commits mailing list