forked from OSchip/llvm-project
parent
dc3f3841fc
commit
87f1b39f2b
|
@ -217,15 +217,15 @@ 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())
|
||||||
|
return;
|
||||||
i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
|
i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
|
||||||
Mi2IndexMap::const_iterator it = mi2iMap_.find(MI);
|
Mi2IndexMap::iterator it = mi2iMap_.find(MI);
|
||||||
assert(it != mi2iMap_.end() && "Invalid instruction!");
|
assert(it != mi2iMap_.end() && "Invalid instruction!");
|
||||||
unsigned Index = it->second;
|
unsigned Index = it->second;
|
||||||
mi2iMap_.erase(MI);
|
mi2iMap_.erase(it);
|
||||||
mi2iMap_[NewMI] = Index;
|
mi2iMap_[NewMI] = Index;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
|
BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue