summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-12-09 01:22:13 +0000
committerJim Grosbach <grosbach@apple.com>2010-12-09 01:22:13 +0000
commitbd30afe4c21b774d24712f1adc451a6294a48c95 (patch)
tree3fe9e15363cf34d52bf3805b10cd89dc527bba04 /llvm/lib/Target/ARM
parent0b2630c500d9aec0c9ad3258c5b06a2e11812340 (diff)
downloadbcm5719-llvm-bd30afe4c21b774d24712f1adc451a6294a48c95.tar.gz
bcm5719-llvm-bd30afe4c21b774d24712f1adc451a6294a48c95.zip
When using multiple instructions to reference a frame index, make sure to
update the opcode when necessary as well as the source register. llvm-svn: 121346
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 3e7c1c3075b..bdecaca37d0 100644
--- a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -1209,7 +1209,12 @@ ARMBaseRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
emitT2RegPlusImmediate(MBB, II, MI.getDebugLoc(), ScratchReg, FrameReg,
Offset, Pred, PredReg, TII);
}
+ // Update the original instruction to use the scratch register.
MI.getOperand(i).ChangeToRegister(ScratchReg, false, false, true);
+ if (MI.getOpcode() == ARM::t2ADDrSPi)
+ MI.setDesc(TII.get(ARM::t2ADDri));
+ else if (MI.getOpcode() == ARM::t2SUBrSPi)
+ MI.setDesc(TII.get(ARM::t2SUBri));
}
}
OpenPOWER on IntegriCloud