[llvm-commits] [llvm] r148272 - in /llvm/trunk: include/llvm/ADT/BitVector.h unittests/ADT/BitVectorTest.cpp

Chris Lattner clattner at apple.com
Tue Jan 17 13:43:57 PST 2012


On Jan 16, 2012, at 11:35 PM, Jakob Stoklund Olesen wrote:

>> >
>> > This patch adds BitVector operations to efficiently apply literal bit
>> > masks specified as arrays of uint32_t.  Since each array entry always
>> > holds exactly 32 bits, these portable bit masks can be source code
>> > literals, probably produced by TableGen.
>> 
>> Out of curiosity, why not arrays of uint64_t?  It will be faster on 64-bit platforms, and shouldn't really be a penalty on 32-bit either.
> 
> It's a speed / size tradeoff. The typical use case is bit vectors of physical registers, which means a bit vector with 160 entries on x86. Using uint64_t would mean a 20% space overhead compared to uint32_t.
> 

Ok!  Thanks Jakob,

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120117/153c96f5/attachment.html>


More information about the llvm-commits mailing list