Enable ARM base pointer when calling functions with large arguments.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 28 Feb 2012 01:15:01 +0000 (01:15 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 28 Feb 2012 01:15:01 +0000 (01:15 +0000)
commit0f9d07fb2526c0acdf7ad9fa6e9c1a97a746c0e9
treee116bd874b7fc50a2150e899dcba97095fd62907
parentdfa1896b6b61e708f002b814794890ff308172ee
Enable ARM base pointer when calling functions with large arguments.

When an outgoing call takes more than 2k of arguments on the stack, we
don't allocate that call frame in the prolog, but adjust the stack
pointer immediately before the call instead.

This causes problems with the emergency spill slot because PEI can't
track stack pointer adjustments on the second pass, and if the outgoing
arguments are too big, SP can't be used to reach the emergency spill
slot at all.

Work around these problems by ensuring there is a base or frame pointer
that can be used to access the emergency spill slot.

<rdar://problem/10917166>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151604 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseRegisterInfo.cpp
lib/Target/ARM/ARMFrameLowering.cpp
lib/Target/ARM/Thumb1RegisterInfo.cpp
test/CodeGen/Thumb2/large-call.ll [new file with mode: 0644]