summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-02-17 21:29:41 +0000
committerLang Hames <lhames@gmail.com>2012-02-17 21:29:41 +0000
commita9afc6ac4adc4786ebc7765d94b1053c540ed89e (patch)
treeb2822b1d71d991da197c63fd284777935ffdb3a9 /llvm/lib/CodeGen
parent320c88afce13bdca7553b670f94f97993cb9a4cb (diff)
downloadbcm5719-llvm-a9afc6ac4adc4786ebc7765d94b1053c540ed89e.tar.gz
bcm5719-llvm-a9afc6ac4adc4786ebc7765d94b1053c540ed89e.zip
Add support for regmask slots to HMEditor. Also fixes a comment error.
llvm-svn: 150840
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index f1f66f28c24..4e66bf61383 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1069,7 +1069,6 @@ public:
assert(intervalRangesSane(li) && "Broke live interval moving use.");
}
- // Returns the new
void moveUseUp(SlotIndex oldIdx, LiveRange& lr, LiveInterval& li) {
bool liveThrough = lr.end > oldIdx.getRegSlot();
if (liveThrough)
@@ -1098,7 +1097,7 @@ public:
}
// Update intervals for all operands of mi from oldIndex to newIndex.
- void moveAllOperands(MachineInstr* mi, SlotIndex oldIdx) {
+ void moveAllOperandsFrom(MachineInstr* mi, SlotIndex oldIdx) {
// Figure out the direction we're moving.
bool movingUp = newIdx < oldIdx;
@@ -1109,6 +1108,11 @@ public:
mopItr != mopEnd; ++mopItr) {
const MachineOperand& mop = *mopItr;
+ if (mop.isRegMask()) {
+ updateRegMaskSlots(oldIdx);
+ continue;
+ }
+
if (!mop.isReg() || mop.getReg() == 0)
continue;
@@ -1249,6 +1253,16 @@ private:
moveUseDown(oldIdx, *lr, li, mbb);
}
}
+
+ void updateRegMaskSlots(SlotIndex oldIdx) {
+ SmallVectorImpl<SlotIndex>::iterator rmItr =
+ std::lower_bound(lis.RegMaskSlots.begin(), lis.RegMaskSlots.end(),
+ oldIdx);
+ assert(*rmItr == oldIdx && "No RegMask at oldIdx.");
+ *rmItr = newIdx;
+ assert(*prior(rmItr) < *rmItr && *rmItr < *next(rmItr) &&
+ "RegSlots out of order. Did you move one call across another?");
+ }
};
void LiveIntervals::handleMove(MachineInstr* mi) {
@@ -1263,5 +1277,5 @@ void LiveIntervals::handleMove(MachineInstr* mi) {
assert(!mi->isBundled() && "Can't handle bundled instructions yet.");
HMEditor hme(*this, newIndex);
- hme.moveAllOperands(mi, oldIndex);
+ hme.moveAllOperandsFrom(mi, oldIndex);
}
OpenPOWER on IntegriCloud