InstCombine: We know the number of items initially added to the worklist map, reserve...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Mar 2011 16:43:46 +0000 (16:43 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Mar 2011 16:43:46 +0000 (16:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127089 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineWorklist.h

index 9100a851f16ed770f4ca193c5e675a7c53bd3d1a..32009c39ec2554a1cf235a103b913fad63dddcf2 100644 (file)
@@ -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];