summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-10-06 21:51:21 +0000
committerBill Wendling <isanbard@gmail.com>2011-10-06 21:51:21 +0000
commit31d973cde647c6837976fdbe2d4c809276d5ead6 (patch)
treea1c099ddc62cf7857597d3e299a2369d81f28b75 /llvm/lib/Target
parent4887469138d6cff7816aadd5724f397bda2981ec (diff)
downloadbcm5719-llvm-31d973cde647c6837976fdbe2d4c809276d5ead6.tar.gz
bcm5719-llvm-31d973cde647c6837976fdbe2d4c809276d5ead6.zip
Use a thumb ORR instead of thumb2 ORR when in thumb-only mode. (Picky! Picky!)
Place the immediate to OR into a register so that it works. llvm-svn: 141319
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 84aa7df7dde..5147e432459 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -5613,7 +5613,8 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
// Incoming value: jbuf
// ldr.n r1, LCPI1_4
// add r1, pc
- // orr r1, r1, #1
+ // mov r2, #1
+ // orrs r1, r2
// add r2, $jbuf, #+4 ; &jbuf[1]
// str r1, [r2]
unsigned NewVReg1 = MRI->createVirtualRegister(TRC);
@@ -5626,17 +5627,21 @@ EmitSjLjDispatchBlock(MachineInstr *MI, MachineBasicBlock *MBB) const {
.addImm(PCLabelId);
// Set the low bit because of thumb mode.
unsigned NewVReg3 = MRI->createVirtualRegister(TRC);
- AddDefaultCC(
- AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::t2ORRri), NewVReg3)
- .addReg(NewVReg2, RegState::Kill)
- .addImm(0x01)));
+ AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::tMOVi8), NewVReg3)
+ .addReg(ARM::CPSR, RegState::Define)
+ .addImm(1));
unsigned NewVReg4 = MRI->createVirtualRegister(TRC);
- AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::tADDrSPi), NewVReg4)
+ AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::tORR), NewVReg4)
+ .addReg(ARM::CPSR, RegState::Define)
+ .addReg(NewVReg2, RegState::Kill)
+ .addReg(NewVReg3, RegState::Kill));
+ unsigned NewVReg5 = MRI->createVirtualRegister(TRC);
+ AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::tADDrSPi), NewVReg5)
.addFrameIndex(FI)
.addImm(36)); // &jbuf[1] :: pc
AddDefaultPred(BuildMI(*MBB, MI, dl, TII->get(ARM::tSTRi))
- .addReg(NewVReg3, RegState::Kill)
.addReg(NewVReg4, RegState::Kill)
+ .addReg(NewVReg5, RegState::Kill)
.addImm(0)
.addMemOperand(FIMMO));
} else {
OpenPOWER on IntegriCloud