Implement X86 code generation for musttail
authorReid Kleckner <reid@kleckner.net>
Tue, 29 Apr 2014 23:55:41 +0000 (23:55 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 29 Apr 2014 23:55:41 +0000 (23:55 +0000)
commit9902128e2a6450644fb4caf929ff0e3a2d6b0704
treefe4b2e756fc7e604d69a318ded6e929c211133f6
parentfc288c83394800c2eb3e6627cd52f72d5f997b4a
Implement X86 code generation for musttail

Currently, musttail codegen is relying on sibcall optimization, and
reporting a fatal error if fails.  Sibcall optimization fails when stack
arguments need to be modified, which is insufficient for musttail.

The logic for moving arguments in memory safely is already implemented
for GuaranteedTailCallOpt.  This change merely arranges for musttail
calls to use it.

No functional change for GuaranteedTailCallOpt.

Reviewers: espindola

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207598 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/musttail-indirect.ll [new file with mode: 0644]
test/CodeGen/X86/musttail-thiscall.ll [new file with mode: 0644]
test/CodeGen/X86/musttail.ll