[PATCH] D58737: [InstrProf] Use separate comdat group for data and counters

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 28 10:38:09 PST 2019

vsk added a comment.

In D58737#1412846 <https://reviews.llvm.org/D58737#1412846>, @rnk wrote:

> Oops, forgot to respond to this...
> In D58737#1412734 <https://reviews.llvm.org/D58737#1412734>, @vsk wrote:
> > I'm confused by this wording re: comdats in the LangRef: "All global objects that specify this key will only end up in the final object file if the linker chooses that key over some other key". Why can multiple global objects with the same comdat key end up in the final object file?
> These words are trying to say that, some number of global objects can use a comdat key. If the object file they are contained in has the prevailing definition of that comdat key, then they will be included, and they will be discarded if not. The prevailing object is typically just the first object file that uses the comdat.
> So, multiple objects from *one TU* can use the key and end up in the final binary, but objects from different TUs will never end up mixed together in the final binary.

Ah, got it, thanks :)




More information about the cfe-commits mailing list