OSDN Git Service

ARM, AArch64, X86: Check preserved registers for tail calls.
authorMatthias Braun <matze@braunis.de>
Mon, 4 Apr 2016 18:56:13 +0000 (18:56 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 4 Apr 2016 18:56:13 +0000 (18:56 +0000)
commitbac1dd9d547c980925406e3655c3e64776b4c703
tree2c4370599a61cffccc5b6d904bcecb62d3c6f964
parent0a41a3198715bba392f186d02e63955363d0341e
ARM, AArch64, X86: Check preserved registers for tail calls.

We can only perform a tail call to a callee that preserves all the
registers that the caller needs to preserve.

This situation happens with calling conventions like preserver_mostcc or
cxx_fast_tls. It was explicitely handled for fast_tls and failing for
preserve_most. This patch generalizes the check to any calling
convention.

Related to rdar://24207743

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265329 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetRegisterInfo.h
lib/CodeGen/TargetRegisterInfo.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/AArch64/tailcall-ccmismatch.ll [new file with mode: 0644]
test/CodeGen/ARM/cxx-tlscc.ll