summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-25 19:39:04 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-25 19:39:04 +0000
commitdf3e2246323c7e9c116fd38cd77df6d2a3b96c16 (patch)
treef78af9cb2e1750a4375199f4e3c5eb9b513c0a27 /llvm
parent892fcd0b0224a23e4c2639f47d614efb248e7eec (diff)
downloadbcm5719-llvm-df3e2246323c7e9c116fd38cd77df6d2a3b96c16.tar.gz
bcm5719-llvm-df3e2246323c7e9c116fd38cd77df6d2a3b96c16.zip
LiveIntervals: Return index from replaceMachineInstrInMaps
Fixes weird asymmetry with insertion llvm-svn: 276678
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h4
-rw-r--r--llvm/include/llvm/CodeGen/SlotIndexes.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
index d4ee0582cc4..e226a0bcc47 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -253,8 +253,8 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs;
Indexes->removeMachineInstrFromMaps(MI);
}
- void ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
- Indexes->replaceMachineInstrInMaps(MI, NewMI);
+ SlotIndex ReplaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
+ return Indexes->replaceMachineInstrInMaps(MI, NewMI);
}
VNInfo::Allocator& getVNInfoAllocator() { return VNInfoAllocator; }
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h
index afb0288b024..01184dc39b3 100644
--- a/llvm/include/llvm/CodeGen/SlotIndexes.h
+++ b/llvm/include/llvm/CodeGen/SlotIndexes.h
@@ -632,11 +632,12 @@ namespace llvm {
}
/// ReplaceMachineInstrInMaps - Replacing a machine instr with a new one in
- /// maps used by register allocator.
- void replaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
+ /// maps used by register allocator. \returns the index where the new
+ /// instruction was inserted.
+ SlotIndex replaceMachineInstrInMaps(MachineInstr &MI, MachineInstr &NewMI) {
Mi2IndexMap::iterator mi2iItr = mi2iMap.find(&MI);
if (mi2iItr == mi2iMap.end())
- return;
+ return SlotIndex();
SlotIndex replaceBaseIndex = mi2iItr->second;
IndexListEntry *miEntry(replaceBaseIndex.listEntry());
assert(miEntry->getInstr() == &MI &&
@@ -644,6 +645,7 @@ namespace llvm {
miEntry->setInstr(&NewMI);
mi2iMap.erase(mi2iItr);
mi2iMap.insert(std::make_pair(&NewMI, replaceBaseIndex));
+ return replaceBaseIndex;
}
/// Add the given MachineBasicBlock into the maps.
OpenPOWER on IntegriCloud