Check for stack space more intelligently.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 3 Dec 2011 09:32:07 +0000 (09:32 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 3 Dec 2011 09:32:07 +0000 (09:32 +0000)
commit199ce33b3bfa0b6293946c1b835da2a1fbc8cab4
tree43997dc62087bd036a23c4db902e1af675fc7049
parent40f8222e1e6d273062e3c1234baa57db3c5705cf
Check for stack space more intelligently.

libgcc sets the stack limit field in TCB to 256 bytes above the actual
allocated stack limit.  This means if the function's stack frame needs
less than 256 bytes, we can just compare the stack pointer with the
stack limit.  This should result in lesser calls to __morestack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145766 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FrameLowering.cpp
test/CodeGen/X86/segmented-stacks.ll