When emitting the function epilog, check to see if there already a stack
authorChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 23:53:43 +0000 (23:53 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 23:53:43 +0000 (23:53 +0000)
commit6972177bd497fd61d43ed90618fe11f827c441c5
treed1a6b372732c38a41f655ea96e7614bc28387524
parent3b8ce85b19186390c8c18ef3a0a3d44bca29da70
When emitting the function epilog, check to see if there already a stack
adjustment.  If so, we merge the adjustment into the existing one.  This
allows us to generate:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        add %ESP, 8
        ret 4

intead of:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        sub %ESP, 4
        add %ESP, 12
        ret 4

for X86/fast-cc-merge-stack-adj.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22038 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86RegisterInfo.cpp