<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 1:50 PM, Rong Xu <span dir="ltr"><<a href="mailto:xur@google.com">xur@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">xur added a comment.<br>
<span class="gmail-"><br>
In <a href="http://reviews.llvm.org/D20078#425034" rel="noreferrer">http://reviews.llvm.org/D20078#425034</a>, @vsk wrote:<br>
<br>
> 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.<br>
<br>
<br>
</span>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.<br>
<span class="gmail-"><br></span></blockquote><div><br></div><div>I added a test in  r268608 which broke darwin testing -- this is when the bug was discovered.</div><div><br></div><div>After this is fixed, that test can be re-enabled.</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">
> 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 :).<br>
<br>
<br>
</span>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.<br>
<br>
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:<br>
 <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20131028/193223.html" rel="noreferrer">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20131028/193223.html</a><br>
<br>
<br>
<a href="http://reviews.llvm.org/D20078" rel="noreferrer">http://reviews.llvm.org/D20078</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>