mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-05 02:07:16 +00:00
Don't add or sub zero to sp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a38bbf7dd3
commit
5293e7d5d6
@ -206,9 +206,11 @@ void ARMRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
||||
|
||||
MFI->setStackSize(NumBytes);
|
||||
|
||||
//sub sp, sp, #NumBytes
|
||||
splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::SUB), ARM::R13,
|
||||
ARM::R13, NumBytes);
|
||||
if (NumBytes) {
|
||||
//sub sp, sp, #NumBytes
|
||||
splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::SUB), ARM::R13,
|
||||
ARM::R13, NumBytes);
|
||||
}
|
||||
|
||||
|
||||
if (HasFP) {
|
||||
@ -234,9 +236,11 @@ void ARMRegisterInfo::emitEpilogue(MachineFunction &MF,
|
||||
BuildMI(MBB, MBBI, TII.get(ARM::LDR), ARM::R11).addReg(ARM::R13).addImm(0);
|
||||
}
|
||||
|
||||
//add sp, sp, #NumBytes
|
||||
splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::ADD), ARM::R13,
|
||||
ARM::R13, NumBytes);
|
||||
if (NumBytes){
|
||||
//add sp, sp, #NumBytes
|
||||
splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::ADD), ARM::R13,
|
||||
ARM::R13, NumBytes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
10
test/CodeGen/ARM/spaddsub.ll
Normal file
10
test/CodeGen/ARM/spaddsub.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llvm-upgrade < %s | llvm-as | llc -f -march=arm -o %t.s &&
|
||||
; RUN: not grep "add r13, r13, #0" < %t.s &&
|
||||
; RUN: not grep "sub r13, r13, #0" < %t.s
|
||||
|
||||
int %f() {
|
||||
entry:
|
||||
ret int 1
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user