[PATCH] D39593: [ADCE] Use MapVector for BlockInfo to make iteration order deterministic

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 05:43:43 PDT 2017


kuhar added inline comments.


================
Comment at: lib/Transforms/Scalar/ADCE.cpp:214
 void AggressiveDeadCodeElimination::initialize() {
-  auto NumBlocks = F.size();
-
-  // We will have an entry in the map for each block so we grow the
-  // structure to twice that size to keep the load factor low in the hash table.
-  BlockInfo.reserve(NumBlocks);
   size_t NumInsts = 0;
 
----------------
I can see that MapVector doesn't expose `.reserve` -- what is the reason for that? While I don't claim that it would have any noticeable performance impact here, I'm a bit surprised by that.


https://reviews.llvm.org/D39593





More information about the llvm-commits mailing list