From 103391d639a19623ed957f366dbd8113f2127c5d Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 5 Mar 2011 16:43:46 +0000 Subject: 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 --- lib/Transforms/InstCombine/InstCombineWorklist.h | 1 + 1 file changed, 1 insertion(+) 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]; -- cgit v1.2.3-18-g5258