<div dir="ltr">On Tue, Jul 9, 2013 at 5:59 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank" class="cremed">tobias@grosser.es</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 05/24/2013 05:26 AM, Diego Novillo wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Author: dnovillo<br>
Date: Fri May 24 07:26:52 2013<br>
New Revision: 182638<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=182638&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project?rev=182638&view=rev</a><br>
Log:<br>
Add a new function attribute 'cold' to functions.<br>
<br>
Other than recognizing the attribute, the patch does little else.<br>
It changes the branch probability analyzer so that edges into<br>
blocks postdominated by a cold function are given low weight.<br>
<br>
Added analysis and code generation tests.  Added documentation for the<br>
new attribute.<br>
</blockquote>
<br></div>
It seems this commit broke bitcode compatibility with LLVM 3.3, but surprisingly not with LLVM 3.2. This suggests that 3.2 did not yet<br>
depend on the order of the attribute enum whereas 3.3 somehow seems<br>
to depend on it. This may be related to Bill's attribute refactoring.<br></blockquote><div><br></div><div>The bitcode representation is supposed to be fixed via the stable masks here:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Modified: llvm/trunk/lib/IR/Attributes.</span><span style="font-family:arial,sans-serif;font-size:13px">cpp</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">URL: </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=182638&r1=182637&r2=182638&view=diff" target="_blank" class="cremed" style="font-family:arial,sans-serif;font-size:13px">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=182638&r1=182637&r2=182638&view=diff</a><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">==============================</span><span style="font-family:arial,sans-serif;font-size:13px">==============================</span><span style="font-family:arial,sans-serif;font-size:13px">==================</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">--- llvm/trunk/lib/IR/Attributes.</span><span style="font-family:arial,sans-serif;font-size:13px">cpp (original)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+++ llvm/trunk/lib/IR/Attributes.</span><span style="font-family:arial,sans-serif;font-size:13px">cpp Fri May 24 07:26:52 2013</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">@@ -396,6 +398,7 @@ uint64_t AttributeImpl::getAttrMask(</span><span style="font-family:arial,sans-serif;font-size:13px">Attr</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">   case Attribute::SanitizeMemory:  return 1ULL << 37;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">   case Attribute::NoBuiltin:       return 1ULL << 38;</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">   case Attribute::Returned:        return 1ULL << 39;</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+  case Attribute::Cold:            return 1ULL << 40;</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">   }</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">   llvm_unreachable("Unsupported attribute type");</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> }</span><br style="font-family:arial,sans-serif;font-size:13px"></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Where we append in order to not change the existing values. If bitcode isn't serializing using these, and instead using the enum in Attributes.h that doesn't specify specific values, that seems like a bug in the new attribute code which we should fix. This is likely just the first attribute to tickle it.</span></div>
</div></div></div>