summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-05 16:43:46 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-05 16:43:46 +0000
commit08c913b6e68e575416da19fcde7e7b10cf12b2ee (patch)
tree784ff55e84b6a1c321c68924631da2db4670800b
parent4d050b6f85b28bd1511aba27377dda941ed6d644 (diff)
downloadbcm5719-llvm-08c913b6e68e575416da19fcde7e7b10cf12b2ee.tar.gz
bcm5719-llvm-08c913b6e68e575416da19fcde7e7b10cf12b2ee.zip
InstCombine: We know the number of items initially added to the worklist map, reserve space early to avoid rehashing.
llvm-svn: 127089
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineWorklist.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h b/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h
index 9100a851f16..32009c39ec2 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h
@@ -53,6 +53,7 @@ public:
void AddInitialGroup(Instruction *const *List, unsigned NumEntries) {
assert(Worklist.empty() && "Worklist must be empty to add initial group");
Worklist.reserve(NumEntries+16);
+ WorklistMap.resize(NumEntries);
DEBUG(errs() << "IC: ADDING: " << NumEntries << " instrs to worklist\n");
for (; NumEntries; --NumEntries) {
Instruction *I = List[NumEntries-1];
OpenPOWER on IntegriCloud