mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
33ae313f2a
In some places, like InstCombine, we resize a DenseMap to fit the elements we intend to put in it, then insert those elements (to avoid continual reallocations as it grows). But .resize(foo) doesn't actually do what people think; it resizes to foo buckets (which is really an implementation detail the user of DenseMap probably shouldn't care about), not the space required to fit foo elements. DenseMap grows if 3/4 of its buckets are full, so this actually causes one forced reallocation every time instead of avoiding a reallocation. This patch makes .resize(foo) do the intuitive thing: it grows to the size necessary to fit foo elements without new allocations. Also include a test to verify that .resize() actually does what we think it does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263522 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
ADT | ||
Analysis | ||
AsmParser | ||
Bitcode | ||
CodeGen | ||
DebugInfo | ||
ExecutionEngine | ||
IR | ||
LineEditor | ||
Linker | ||
MC | ||
MI | ||
ObjectYAML | ||
Option | ||
ProfileData | ||
Support | ||
Transforms | ||
CMakeLists.txt |