[PATCH] D64045: [InstrProfiling] Put instrumentation into comdat group with function

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 24 22:32:13 PDT 2020


phosek added a comment.

In D64045#1766212 <https://reviews.llvm.org/D64045#1766212>, @pcc wrote:

> Should this be using !associated metadata on ELF instead of comdats?


I agree that `!associated` metadata is a better fit than comdats, the problem is that `!associated` metadata is lowered to `SHF_LINK_ORDER` which is not the correct representation; the intended use case for `SHF_LINK_ORDER` is to control the section output order (see https://groups.google.com/g/generic-abi/c/avQCrdIALKE) which is not the case here. I think the most appropriate representation in ELF is section group (just a plain section group, not comdat), but there's no way to currently express that in LLVM IR. One option would be to change the lowering of `!associated` metadata to use section groups and then use `!associated` metadata in this change.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64045/new/

https://reviews.llvm.org/D64045





More information about the llvm-commits mailing list