summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-02-15 23:21:33 +0000
committerLang Hames <lhames@gmail.com>2012-02-15 23:21:33 +0000
commitcc2037be2cf0159e9f7a917a4db434258fe6eb6b (patch)
treedbdc24337bcd60b38f7009e8ccb9e3416823ec5c /lib
parent2de3ff50439918b5a822b3d06d4d7c5826e11e6c (diff)
downloadllvm-cc2037be2cf0159e9f7a917a4db434258fe6eb6b.tar.gz
llvm-cc2037be2cf0159e9f7a917a4db434258fe6eb6b.tar.bz2
llvm-cc2037be2cf0159e9f7a917a4db434258fe6eb6b.tar.xz
Make LiveIntervals::handleMove() bundle aware.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp10
-rw-r--r--lib/CodeGen/MachineInstr.cpp10
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index a8aa21a96a..0bf47322ba 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -963,13 +963,15 @@ static void handleMoveUses(const MachineBasicBlock *mbb,
}
}
-void LiveIntervals::handleMove(MachineInstr *mi) {
+
+
+void LiveIntervals::handleMove(MachineInstr* mi) {
SlotIndex origIdx = indexes_->getInstructionIndex(mi);
indexes_->removeMachineInstrFromMaps(mi);
- SlotIndex miIdx = indexes_->insertMachineInstrInMaps(mi);
-
+ SlotIndex miIdx = mi->isInsideBundle() ?
+ indexes_->getInstructionIndex(mi->getBundleStart()) :
+ indexes_->insertMachineInstrInMaps(mi);
MachineBasicBlock* mbb = mi->getParent();
-
assert(getMBBStartIdx(mbb) <= origIdx && origIdx < getMBBEndIdx(mbb) &&
"Cannot handle moves across basic block boundaries.");
assert(!mi->isBundled() && "Can't handle bundled instructions yet.");
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index ff32a66b14..52a90960ec 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -900,6 +900,16 @@ bool MachineInstr::isBundled() const {
return nextMI != Parent->instr_end() && nextMI->isInsideBundle();
}
+MachineInstr* MachineInstr::getBundleStart() {
+ if (!isInsideBundle())
+ return this;
+ MachineBasicBlock::reverse_instr_iterator MII(this);
+ --MII;
+ while (MII->isInsideBundle())
+ --MII;
+ return &*MII;
+}
+
bool MachineInstr::isStackAligningInlineAsm() const {
if (isInlineAsm()) {
unsigned ExtraInfo = getOperand(InlineAsm::MIOp_ExtraInfo).getImm();