Ah, thanks Hal.<br><br>LGTM then with the comment change.<div><br></div><div>-eric</div><br><div class="gmail_quote">On Thu Nov 13 2014 at 3:09:59 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">----- Original Message -----<br>
> From: "Bill Seurer" <<a href="mailto:seurer@linux.vnet.ibm.com" target="_blank">seurer@linux.vnet.ibm.com</a>><br>
> To: <a href="mailto:seurer@linux.vnet.ibm.com" target="_blank">seurer@linux.vnet.ibm.com</a>, <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>, <a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>, <a href="mailto:wschmidt@linux.vnet.ibm.com" target="_blank">wschmidt@linux.vnet.ibm.com</a><br>
> Cc: <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> Sent: Thursday, November 13, 2014 4:57:55 PM<br>
> Subject: Re: [PATCH] Change order of tablegen generated fastisel instruction code to be based on instruction<br>
> complexity<br>
><br>
> ================<br>
> Comment at:<br>
> /home/seurer/llvm/llvm-oneoff/<u></u>utils/TableGen/<u></u>FastISelEmitter.cpp:595<br>
> @@ -570,2 +594,3 @@<br>
><br>
> -    SimplePatterns[Operands][<u></u>OpcodeName][VT][RetVT][<u></u>PredicateCheck]<br>
> = Memo;<br>
> +// This was used when testing<br>
> +//    if<br>
> (SimplePatterns[Operands][<u></u>OpcodeName][VT][RetVT].count(<u></u>complexity))<br>
> {<br>
> ----------------<br>
> echristo wrote:<br>
> > seurer wrote:<br>
> > > echristo wrote:<br>
> > > > Is there a reason we either a) don't want this on by default,<br>
> > > > or b) would never want this on?<br>
> > > When I tried it generated over 150 warnings so it's probably just<br>
> > > too noisy.  I wasn't sure if multiple patterns having the same<br>
> > > complexity could be a potential issue, though.<br>
> > Yeah, I don't think so. Go ahead and just delete the commented out<br>
> > code with a "Two patterns could have the same complexity and we<br>
> > just end up picking the first one" or something like that. (I<br>
> > think it's the first one at this point?)<br>
> They all will still be generated because the predicates are<br>
> different.  I believe the order will be the order in which they are<br>
> encountered.<br>
><br>
> "When iterating over a std::multimap the elements are ordered by key,<br>
> but the order of elements having the same key is not specified."<br>
><br>
> Hmmm, maybe not.<br>
<br>
It was unspecified in C++ before C++11, but since C++11, the order is specified to be stable. LLVM has other dependencies on this, IIRC.<br>
<br>
<a href="http://stackoverflow.com/questions/2643473/does-stdmultiset-guarantee-insertion-order?rq=1" target="_blank">http://stackoverflow.com/<u></u>questions/2643473/does-<u></u>stdmultiset-guarantee-<u></u>insertion-order?rq=1</a><br>
<br>
 -Hal<br>
<br>
><br>
> <a href="http://reviews.llvm.org/D6220" target="_blank">http://reviews.llvm.org/D6220</a><br>
><br>
><br>
><br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</blockquote></div>