forked from OSchip/llvm-project
Use an iterator instead of calling .size() on the worklist every time, which is wasteful.
llvm-svn: 152794
This commit is contained in:
parent
00d898d6b0
commit
7fa1be77cc
|
@ -55,9 +55,9 @@ public:
|
|||
Worklist.reserve(NumEntries+16);
|
||||
WorklistMap.resize(NumEntries);
|
||||
DEBUG(errs() << "IC: ADDING: " << NumEntries << " instrs to worklist\n");
|
||||
for (; NumEntries; --NumEntries) {
|
||||
for (unsigned Idx = 0; NumEntries; --NumEntries) {
|
||||
Instruction *I = List[NumEntries-1];
|
||||
WorklistMap.insert(std::make_pair(I, Worklist.size()));
|
||||
WorklistMap.insert(std::make_pair(I, Idx++));
|
||||
Worklist.push_back(I);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue