aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-02-15 01:23:52 +0000
committerLang Hames <lhames@gmail.com>2012-02-15 01:23:52 +0000
commitda7984fbbac967ddbe5de4e789f8f37c673a7d75 (patch)
treeb33581b63edba531487915a1c3764e4bb5216e6c /lib/CodeGen/LiveIntervalAnalysis.cpp
parentbbfa5c02be2ef2a9ff965a4dcfe9e99665dcf0ef (diff)
downloadexternal_llvm-da7984fbbac967ddbe5de4e789f8f37c673a7d75.zip
external_llvm-da7984fbbac967ddbe5de4e789f8f37c673a7d75.tar.gz
external_llvm-da7984fbbac967ddbe5de4e789f8f37c673a7d75.tar.bz2
Disentangle moving a machine instr from updating LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 30374da..d27b8e5 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -963,22 +963,17 @@ static void handleMoveUses(const MachineBasicBlock *mbb,
}
}
-void LiveIntervals::moveInstr(MachineBasicBlock::iterator insertPt,
- MachineInstr *mi) {
- MachineBasicBlock* mbb = mi->getParent();
- assert((insertPt == mbb->end() || insertPt->getParent() == mbb) &&
- "Cannot handle moves across basic block boundaries.");
- assert(&*insertPt != mi && "No-op move requested?");
- assert(!mi->isBundled() && "Can't handle bundled instructions yet.");
-
- // Grab the original instruction index.
+void LiveIntervals::handleMove(MachineInstr *mi) {
SlotIndex origIdx = indexes_->getInstructionIndex(mi);
-
- // Move the machine instr and obtain its new index.
indexes_->removeMachineInstrFromMaps(mi);
- mbb->splice(insertPt, mbb, mi);
SlotIndex miIdx = indexes_->insertMachineInstrInMaps(mi);
+ MachineBasicBlock* mbb = mi->getParent();
+
+ assert(getMBBFromIndex(origIdx) == mbb &&
+ "Cannot handle moves across basic block boundaries.");
+ assert(!mi->isBundled() && "Can't handle bundled instructions yet.");
+
// Pick the direction.
bool movingUp = miIdx < origIdx;