summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2013-02-20 22:10:00 +0000
committerCameron Zwarich <zwarich@apple.com>2013-02-20 22:10:00 +0000
commitcaad7e10c1edbd0bff9d54351f174a497998232e (patch)
tree97a9b200db78b3a1c6dfb142bc56c1da2b5404f9 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent8e7dc068c9237822867fb60f96da1494999de75e (diff)
downloadbcm5719-llvm-caad7e10c1edbd0bff9d54351f174a497998232e.tar.gz
bcm5719-llvm-caad7e10c1edbd0bff9d54351f174a497998232e.zip
Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically. llvm-svn: 175673
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 99d36071cfa..43d06557084 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1150,15 +1150,8 @@ tryInstructionTransform(MachineBasicBlock::iterator &mi,
LV->addVirtualRegisterKilled(Reg, NewMIs[1]);
}
- MachineBasicBlock::iterator Begin;
- MachineBasicBlock::iterator End;
SmallVector<unsigned, 4> OrigRegs;
if (LIS) {
- Begin = MachineBasicBlock::iterator(NewMIs[0]);
- if (Begin != MBB->begin())
- --Begin;
- End = llvm::next(MachineBasicBlock::iterator(MI));
-
for (MachineInstr::const_mop_iterator MOI = MI.operands_begin(),
MOE = MI.operands_end(); MOI != MOE; ++MOI) {
if (MOI->isReg())
@@ -1169,8 +1162,11 @@ tryInstructionTransform(MachineBasicBlock::iterator &mi,
MI.eraseFromParent();
// Update LiveIntervals.
- if (LIS)
+ if (LIS) {
+ MachineBasicBlock::iterator Begin(NewMIs[0]);
+ MachineBasicBlock::iterator End(NewMIs[1]);
LIS->repairIntervalsInRange(MBB, Begin, End, OrigRegs);
+ }
mi = NewMIs[1];
if (TransformSuccess)
@@ -1576,9 +1572,6 @@ eliminateRegSequence(MachineBasicBlock::iterator &MBBI) {
}
// Udpate LiveIntervals.
- if (LIS) {
- if (MBBI != MBB->begin())
- --MBBI;
+ if (LIS)
LIS->repairIntervalsInRange(MBB, MBBI, EndMBBI, OrigRegs);
- }
}
OpenPOWER on IntegriCloud