Make the DenseMap bucket type configurable and use a smaller bucket for DenseSet.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 6 Dec 2014 19:22:44 +0000 (19:22 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 6 Dec 2014 19:22:44 +0000 (19:22 +0000)
commit2cd5836249784d4797cd4d79504debec4cb4ce37
tree4fe78938fc3a8ef3024ca1509cdff47519673751
parent51df2c2a106440b4b9fb7309da922ef0ba244a15
Make the DenseMap bucket type configurable and use a smaller bucket for DenseSet.

DenseSet used to be implemented as DenseMap<Key, char>, which usually doubled
the memory footprint of the map. Now we use a compressed set so the second
element uses no memory at all. This required some surgery on DenseMap as
all accesses to the bucket now have to go through methods; this should
have no impact on the behavior of DenseMap though. The new default bucket
type for DenseMap is a slightly extended std::pair as we expose it through
DenseMap's iterator and don't want to break any existing users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223588 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseMap.h
include/llvm/ADT/DenseSet.h
include/llvm/IR/Module.h
lib/Target/AArch64/AArch64PromoteConstant.cpp