summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-11-14 02:55:43 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-11-14 02:55:43 +0000
commit6ad7da96fefb4364aaa8dfb8c695511bdaaac85d (patch)
tree51697f1065fb2058aff63c04fc692cc5caf13917 /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
parente598a56d30386bd0e52d0be087ac5e7b6ee8b3e9 (diff)
downloadbcm5719-llvm-6ad7da96fefb4364aaa8dfb8c695511bdaaac85d.tar.gz
bcm5719-llvm-6ad7da96fefb4364aaa8dfb8c695511bdaaac85d.zip
- Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the sub-register instead. This fixes PR5423. llvm-svn: 88745
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 868d31dbe0e..7925101d5a9 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -921,8 +921,15 @@ void ARMBaseInstrInfo::
reMaterialize(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
unsigned DestReg, unsigned SubIdx,
- const MachineInstr *Orig) const {
+ const MachineInstr *Orig,
+ const TargetRegisterInfo *TRI) const {
DebugLoc dl = Orig->getDebugLoc();
+
+ if (SubIdx && TargetRegisterInfo::isPhysicalRegister(DestReg)) {
+ DestReg = TRI->getSubReg(DestReg, SubIdx);
+ SubIdx = 0;
+ }
+
unsigned Opcode = Orig->getOpcode();
switch (Opcode) {
default: {
OpenPOWER on IntegriCloud