mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
LiveIntervals: Return index from replaceMachineInstrInMaps
Fixes weird asymmetry with insertion llvm-svn: 276678
This commit is contained in:
parent
3e23d35ce5
commit
ae2e679ac3
@ -253,8 +253,8 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs;
|
|||||||
Indexes->removeMachineInstrFromMaps(MI);
|
Indexes->removeMachineInstrFromMaps(MI);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
|
SlotIndex ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
|
||||||
Indexes->replaceMachineInstrInMaps(MI, NewMI);
|
return Indexes->replaceMachineInstrInMaps(MI, NewMI);
|
||||||
}
|
}
|
||||||
|
|
||||||
VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; }
|
VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; }
|
||||||
|
@ -632,11 +632,12 @@ namespace llvm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
|
/// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
|
||||||
/// maps used by register allocator.
|
/// maps used by register allocator. \returns the index where the new
|
||||||
void replaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
|
/// instruction was inserted.
|
||||||
|
SlotIndex replaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
|
||||||
Mi2IndexMap::iterator mi2iItr = mi2iMap.find(&MI);
|
Mi2IndexMap::iterator mi2iItr = mi2iMap.find(&MI);
|
||||||
if (mi2iItr == mi2iMap.end())
|
if (mi2iItr == mi2iMap.end())
|
||||||
return;
|
return SlotIndex();
|
||||||
SlotIndex replaceBaseIndex = mi2iItr->second;
|
SlotIndex replaceBaseIndex = mi2iItr->second;
|
||||||
IndexListEntry *miEntry(replaceBaseIndex.listEntry());
|
IndexListEntry *miEntry(replaceBaseIndex.listEntry());
|
||||||
assert(miEntry->getInstr() == &MI &&
|
assert(miEntry->getInstr() == &MI &&
|
||||||
@ -644,6 +645,7 @@ namespace llvm {
|
|||||||
miEntry->setInstr(&NewMI);
|
miEntry->setInstr(&NewMI);
|
||||||
mi2iMap.erase(mi2iItr);
|
mi2iMap.erase(mi2iItr);
|
||||||
mi2iMap.insert(std::make_pair(&NewMI, replaceBaseIndex));
|
mi2iMap.insert(std::make_pair(&NewMI, replaceBaseIndex));
|
||||||
|
return replaceBaseIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add the given MachineBasicBlock into the maps.
|
/// Add the given MachineBasicBlock into the maps.
|
||||||
|
Loading…
Reference in New Issue
Block a user