From: Benjamin Kramer Date: Sat, 5 Mar 2011 16:43:46 +0000 (+0000) Subject: InstCombine: We know the number of items initially added to the worklist map, reserve... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=103391d639a19623ed957f366dbd8113f2127c5d;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/InstCombine/InstCombineWorklist.h b/lib/Transforms/InstCombine/InstCombineWorklist.h index 9100a851f16..32009c39ec2 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];