summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-10-01 20:54:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-10-01 20:54:53 +0000
commit6f012d83f2265a84f25253a998e8b3fe00f220f2 (patch)
tree81a83f4c631373a0d03e1060634f3d0d03d54881 /llvm/lib
parent7dbc2652b92acca9f81de22766d904b124ce6e05 (diff)
downloadbcm5719-llvm-6f012d83f2265a84f25253a998e8b3fe00f220f2.tar.gz
bcm5719-llvm-6f012d83f2265a84f25253a998e8b3fe00f220f2.zip
ARM::tPOP and tPOP_RET each has an extra writeback operand now.
llvm-svn: 83214
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp6
-rw-r--r--llvm/lib/Target/ARM/Thumb1InstrInfo.cpp1
-rw-r--r--llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp1
3 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index c44ea2ea2ad..43a823daee0 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -1359,9 +1359,11 @@ bool ARMConstantIslands::UndoLRSpillRestore() {
bool MadeChange = false;
for (unsigned i = 0, e = PushPopMIs.size(); i != e; ++i) {
MachineInstr *MI = PushPopMIs[i];
+ // First two operands are predicates, the third is a zero since there
+ // is no writeback.
if (MI->getOpcode() == ARM::tPOP_RET &&
- MI->getOperand(2).getReg() == ARM::PC &&
- MI->getNumExplicitOperands() == 3) {
+ MI->getOperand(3).getReg() == ARM::PC &&
+ MI->getNumExplicitOperands() == 4) {
BuildMI(MI->getParent(), MI->getDebugLoc(), TII->get(ARM::tBX_RET));
MI->eraseFromParent();
MadeChange = true;
diff --git a/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp b/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp
index dc4ce64fe75..e1f9338bc3f 100644
--- a/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp
+++ b/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp
@@ -178,6 +178,7 @@ restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
DebugLoc DL = MI->getDebugLoc();
MachineInstrBuilder MIB = BuildMI(MF, DL, get(ARM::tPOP));
AddDefaultPred(MIB);
+ MIB.addReg(0); // No write back.
bool NumRegs = 0;
for (unsigned i = CSI.size(); i != 0; --i) {
diff --git a/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp b/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
index ea5f0727a10..0cea27f74d3 100644
--- a/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
@@ -863,6 +863,7 @@ void Thumb1RegisterInfo::emitEpilogue(MachineFunction &MF,
// Epilogue for vararg functions: pop LR to R3 and branch off it.
// FIXME: Verify this is still ok when R3 is no longer being reserved.
AddDefaultPred(BuildMI(MBB, MBBI, dl, TII.get(ARM::tPOP)))
+ .addReg(0) // No write back.
.addReg(ARM::R3, RegState::Define);
emitSPUpdate(MBB, MBBI, TII, dl, *this, VARegSaveSize);
OpenPOWER on IntegriCloud