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)
commit89e5306f43422827bd8f42739f3185cec1f6a616
treebc28412ddb52e06e8f720c74e95e935c0ed7653c
parent8e5dc5378489cda4f4db612acd045473b0f5420a
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.

llvm-svn: 223588
llvm/include/llvm/ADT/DenseMap.h
llvm/include/llvm/ADT/DenseSet.h
llvm/include/llvm/IR/Module.h
llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp