[PATCH] Change order of tablegen generated fastisel instruction code to be based on instruction complexity

Hal Finkel hfinkel at anl.gov
Thu Nov 13 15:09:56 PST 2014


----- Original Message -----
> From: "Bill Seurer" <seurer at linux.vnet.ibm.com>
> To: seurer at linux.vnet.ibm.com, hfinkel at anl.gov, echristo at gmail.com, wschmidt at linux.vnet.ibm.com
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Thursday, November 13, 2014 4:57:55 PM
> Subject: Re: [PATCH] Change order of tablegen generated fastisel instruction code to be based on instruction
> complexity
> 
> ================
> Comment at:
> /home/seurer/llvm/llvm-oneoff/utils/TableGen/FastISelEmitter.cpp:595
> @@ -570,2 +594,3 @@
>  
> -    SimplePatterns[Operands][OpcodeName][VT][RetVT][PredicateCheck]
> = Memo;
> +// This was used when testing
> +//    if
> (SimplePatterns[Operands][OpcodeName][VT][RetVT].count(complexity))
> {
> ----------------
> echristo wrote:
> > seurer wrote:
> > > echristo wrote:
> > > > Is there a reason we either a) don't want this on by default,
> > > > or b) would never want this on?
> > > When I tried it generated over 150 warnings so it's probably just
> > > too noisy.  I wasn't sure if multiple patterns having the same
> > > complexity could be a potential issue, though.
> > Yeah, I don't think so. Go ahead and just delete the commented out
> > code with a "Two patterns could have the same complexity and we
> > just end up picking the first one" or something like that. (I
> > think it's the first one at this point?)
> They all will still be generated because the predicates are
> different.  I believe the order will be the order in which they are
> encountered.
> 
> "When iterating over a std::multimap the elements are ordered by key,
> but the order of elements having the same key is not specified."
> 
> Hmmm, maybe not.

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.

http://stackoverflow.com/questions/2643473/does-stdmultiset-guarantee-insertion-order?rq=1

 -Hal  

> 
> http://reviews.llvm.org/D6220
> 
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list