[llvm-commits] [llvm] r133051 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/Target/TargetRegisterInfo.cpp utils/TableGen/RegisterInfoEmitter.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jun 15 10:27:58 PDT 2011


On Jun 14, 2011, at 11:53 PM, Owen Anderson wrote:

> Author: resistor
> Date: Wed Jun 15 01:53:50 2011
> New Revision: 133051
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=133051&view=rev
> Log:
> Replace the statically generated hashtables for checking register relationships with just scanning the (typically tiny) static lists.
> 
> At the time I wrote this code (circa 2007), TargetRegisterInfo was using a std::set to perform these queries.  Switching to the static hashtables was an obvious improvement, but in reality there's no reason to do anything other than scan.
> With this change, total LLC time on a whole-program 403.gcc is reduced by approximately 1.5%, almost all of which comes from a 15% reduction in LiveVariables time.  It also reduces the binary size of LLC by 86KB, thanks to eliminating a bunch of very large static tables.

Nice!

So if compressing the hash tables make them slower, you just have to compress them harder.

LiveVariables calls TRI::isSubRegister() about 1000 times per call site when setting <dead> flags on CALL instructions. We ought to fix that.

Next up: Get rid of that DenseSet in TargetRegisterClass. A constant bit vector would be smaller and faster, but we don't want to use llvm::BitVector since it has a constructor.

/jakob




More information about the llvm-commits mailing list