Simplify.

llvm-svn: 47059
This commit is contained in:
Evan Cheng 2008-02-13 09:18:16 +00:00
parent dc3f3841fc
commit 87f1b39f2b
1 changed files with 8 additions and 8 deletions
llvm/include/llvm/CodeGen

View File

@ -217,14 +217,14 @@ namespace llvm {
/// maps used by register allocator. /// maps used by register allocator.
void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) { void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) {
Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI); Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
if (mi2i != mi2iMap_.end()) { if (mi2i == mi2iMap_.end())
i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI; return;
Mi2IndexMap::const_iterator it = mi2iMap_.find(MI); i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
assert(it != mi2iMap_.end() && "Invalid instruction!"); Mi2IndexMap::iterator it = mi2iMap_.find(MI);
unsigned Index = it->second; assert(it != mi2iMap_.end() && "Invalid instruction!");
mi2iMap_.erase(MI); unsigned Index = it->second;
mi2iMap_[NewMI] = Index; mi2iMap_.erase(it);
} mi2iMap_[NewMI] = Index;
} }
BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; } BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }