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

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 15:18:57 PST 2019

rnk added a comment.

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?

I agree, that wording seems very confusing. I probably even wrote it. I'll try editing it and send you the result later.

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.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list