[PATCH] D20078: PGO] Fix __llvm_profile_raw_version linkage in MACHO

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 13:50:27 PDT 2016


xur added a comment.

In http://reviews.llvm.org/D20078#425034, @vsk wrote:

> Wow, so without this fix are IR profiles unusable on macho? I'm not sure if I'm understanding this correctly because it doesn't seem like that could pass testing.


Unfortunately, this is true: IR profiles is broken in MACHO for profile-use. We don't have an end-to-end PGO test for IR profiles. I will add later.

> Also, is "weak_def_can_be_hidden" incorrect because __llvm_profile_raw_version isn't supposed to be "hidden"? I'd appreciate it if you could point me to any resources that discuss the difference between weak_def_can_be_hidden and weak_definition -- if there aren't any I can dig a bit more :).


Our tests show that what attribute (weak_def_can_be_hidden or weak_definition) to use does not seem to matter --- we just cannot mix this two. I chose weak_definition because it's easier to write the code in the profile run-time (just use __attribute__((weak)) as it's). It's harder to write code to generate the weak_def_can_be_hidden attribute.

We thought apple has better documentation about weak_def_can_be_hidden because this seems to be macho specific. I only find a few references online. Here is one:
 http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20131028/193223.html


http://reviews.llvm.org/D20078





More information about the llvm-commits mailing list