Skip to content

Commit d980633

Browse files
author
serge-sans-paille
committed
Use SmallVector instead of std::vector to manage storage of llvm::BitVector
This is a follow-up to https://reviews.llvm.org/D100387. std::vector is not the best storage container here. My local benchmark (counting the number of instruction when compiling the sqlite3 amalgamation) yields the following: - std::vector<BitVector> -> 5,860,885,896 - SmallVector<BitWord, 0> -> 5,858,991,997 - SmallVector<BitWord> -> 5,817,679,224 Differential Revision: https://reviews.llvm.org/D100744
1 parent dd56715 commit d980633

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/BitVector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class BitVector {
7979
static_assert(BITWORD_SIZE == 64 || BITWORD_SIZE == 32,
8080
"Unsupported word size");
8181

82-
using Storage = std::vector<BitWord>;
82+
using Storage = SmallVector<BitWord>;
8383

8484
Storage Bits; // Actual bits.
8585
unsigned Size; // Size of bitvector in bits.

0 commit comments

Comments
 (0)