diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-04-30 22:15:59 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-04-30 22:15:59 +0000 |
commit | 5111881cfcd8e5e61aa637b92acd536dd7bc0325 (patch) | |
tree | ec395933af6aa9c013ac01301b6657df06f2d45f /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | af67602e1491592b73f8909b26c8c2539009c8d7 (diff) | |
download | bcm5719-llvm-5111881cfcd8e5e61aa637b92acd536dd7bc0325.tar.gz bcm5719-llvm-5111881cfcd8e5e61aa637b92acd536dd7bc0325.zip |
Don't always apply kill flag in thumb2 ABS pseudo expansion.
The expansion for t2ABS was always setting the kill flag on the rsb instruction.
It should instead only be set on rsb if it was set on the original ABS instruction.
rdar://problem/20752113
llvm-svn: 236272
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 5f593d6f986..bdcf86cfed6 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -7501,6 +7501,7 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, unsigned int ABSSrcReg = MI->getOperand(1).getReg(); unsigned int ABSDstReg = MI->getOperand(0).getReg(); + bool ABSSrcKIll = MI->getOperand(1).isKill(); bool isThumb2 = Subtarget->isThumb2(); MachineRegisterInfo &MRI = Fn->getRegInfo(); // In Thumb mode S must not be specified if source register is the SP or @@ -7534,7 +7535,7 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, // by if-conversion pass BuildMI(*RSBBB, RSBBB->begin(), dl, TII->get(isThumb2 ? ARM::t2RSBri : ARM::RSBri), NewRsbDstReg) - .addReg(ABSSrcReg, RegState::Kill) + .addReg(ABSSrcReg, ABSSrcKIll ? RegState::Kill : 0) .addImm(0).addImm((unsigned)ARMCC::AL).addReg(0).addReg(0); // insert PHI in SinkBB, |