[X86] Elide references to _chkstk for dynamic allocas
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 1 Mar 2016 19:20:23 +0000 (19:20 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 1 Mar 2016 19:20:23 +0000 (19:20 +0000)
commit791b88b6da79b9d296fd31f20529efb20d23af63
treea8be75f286397cb104f80659c7c9e9f6822a804d
parent2abc587c1ef126850cd230e44deca6e93fab0b9b
[X86] Elide references to _chkstk for dynamic allocas

The _chkstk function is called by the compiler to probe the stack in an
order consistent with Windows' expectations.  However, it is possible to
elide the call to _chkstk and manually adjust the stack pointer if we
can prove that the allocation is fixed size and smaller than the probe
size.

This shrinks chrome.dll, chrome_child.dll and chrome.exe by a
cummulative ~133 KB.

Differential Revision: http://reviews.llvm.org/D17679

llvm-svn: 262370
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/cleanuppad-inalloca.ll
llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll
llvm/test/CodeGen/X86/inalloca-ctor.ll
llvm/test/CodeGen/X86/inalloca-invoke.ll
llvm/test/CodeGen/X86/inalloca-stdcall.ll
llvm/test/CodeGen/X86/inalloca.ll
llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll