OSDN Git Service

ARM: Do not spill CSR to stack on entry to noreturn functions
authorTim Northover <tnorthover@apple.com>
Thu, 5 Apr 2018 14:26:06 +0000 (14:26 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 5 Apr 2018 14:26:06 +0000 (14:26 +0000)
commit1444c19a6b85a22f50a90c98e115c0fbb6a294e5
tree1879bc920984e4cfc2b666f07f5661fcf1bd1c88
parent1cdf10abfa33d3df2209fefe8c4c8f27c91b998c
ARM: Do not spill CSR to stack on entry to noreturn functions

A noreturn nounwind function can be expected to never return in any way, and by
never returning it will also never have to restore any callee-saved registers
for its caller. This makes it possible to skip spills of those registers during
function entry, saving some stack space and time in the process. This is rather
useful for embedded targets with limited stack space.

Should fix PR9970.

Patch by myeisha (pmb).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329287 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetFrameLowering.h
lib/CodeGen/TargetFrameLoweringImpl.cpp
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/ARMFrameLowering.h
test/CodeGen/AArch64/arm64-shrink-wrapping.ll
test/CodeGen/ARM/arm-shrink-wrapping.ll
test/CodeGen/ARM/noreturn-csr-skip.mir [new file with mode: 0644]
test/CodeGen/PowerPC/ppc-shrink-wrapping.ll
test/CodeGen/Thumb/thumb-shrink-wrapping.ll
test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll
test/CodeGen/X86/x86-shrink-wrapping.ll