<div dir="ltr">Will do. Not sure there is an md5sum mechanism in the regression framework, but I can presumably modify one of my existing functions summary test cases that uses llvm-bcanalyzer to confirm the ordering.<div><br></div><div>Teresa</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 12:25 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks! Can you add a testcase?<br>
<br>
Cheers,<br>
Rafael<br>
<br>
<br>
On 1 February 2016 at 15:16, Teresa Johnson via llvm-commits<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: tejohnson<br>
> Date: Mon Feb  1 14:16:35 2016<br>
> New Revision: 259398<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=259398&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=259398&view=rev</a><br>
> Log:<br>
> [ThinLTO] Ensure function summary output order is stable<br>
><br>
> Iterate over the function list instead of a DenseMap of Function pointers<br>
> when emitting the function summary into the module.<br>
><br>
> This fixes PR26419.<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
><br>
> Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=259398&r1=259397&r2=259398&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=259398&r1=259397&r2=259398&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)<br>
> +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Feb  1 14:16:35 2016<br>
> @@ -2800,16 +2800,22 @@ static void WritePerModuleFunctionSummar<br>
>    unsigned FSAbbrev = Stream.EmitAbbrev(Abbv);<br>
><br>
>    SmallVector<unsigned, 64> NameVals;<br>
> -  for (auto &I : FunctionIndex) {<br>
> +  // Iterate over the list of functions instead of the FunctionIndex map to<br>
> +  // ensure the ordering is stable.<br>
> +  for (const Function &F : *M) {<br>
> +    if (F.isDeclaration())<br>
> +      continue;<br>
>      // Skip anonymous functions. We will emit a function summary for<br>
>      // any aliases below.<br>
> -    if (!I.first->hasName())<br>
> +    if (!F.hasName())<br>
>        continue;<br>
><br>
> +    assert(FunctionIndex.count(&F) == 1);<br>
> +<br>
>      WritePerModuleFunctionSummaryRecord(<br>
> -        NameVals, I.second->functionSummary(),<br>
> -        VE.getValueID(M->getValueSymbolTable().lookup(I.first->getName())),<br>
> -        FSAbbrev, Stream);<br>
> +        NameVals, FunctionIndex[&F]->functionSummary(),<br>
> +        VE.getValueID(M->getValueSymbolTable().lookup(F.getName())), FSAbbrev,<br>
> +        Stream);<br>
>    }<br>
><br>
>    for (const GlobalAlias &A : M->aliases()) {<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:Times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div>