const ARMSubtarget &sti)
: ARMGenRegisterInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP),
TII(tii), STI(sti),
- FramePtr(STI.useThumbBacktraces() ? ARM::R7 : ARM::R11) {
+ FramePtr(STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : ARM::R11) {
}
bool ARMRegisterInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
unsigned ARMRegisterInfo::getFrameRegister(MachineFunction &MF) const {
if (STI.isTargetDarwin() || hasFP(MF))
- return STI.useThumbBacktraces() ? ARM::R7 : ARM::R11;
+ return STI.useThumbBacktraces() || STI.isThumb() ? ARM::R7 : ARM::R11;
else
return ARM::SP;
}
--- /dev/null
+; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-apple-darwin \
+; RUN: -disable-fp-elim | not grep {r11}
+; RUN: llvm-as < %s | llc -march=thumb -mtriple=arm-linux-gnueabi \
+; RUN: -disable-fp-elim | not grep {r11}
+
+define i32 @f() {
+entry:
+ ret i32 10
+}