diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-05 16:43:46 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-05 16:43:46 +0000 |
commit | 103391d639a19623ed957f366dbd8113f2127c5d (patch) | |
tree | 127b715dda8f0ce2302823800411e94fef615a73 | |
parent | 49d443053bf6565f2420692b54f96abffa76f236 (diff) |
InstCombine: We know the number of items initially added to the worklist map, reserve space early to avoid rehashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127089 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineWorklist.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineWorklist.h b/lib/Transforms/InstCombine/InstCombineWorklist.h index 9100a851f1..32009c39ec 100644 --- a/lib/Transforms/InstCombine/InstCombineWorklist.h +++ b/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]; |