diff options
| author | Matthias Braun <matze@braunis.de> | 2016-04-04 18:56:13 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2016-04-04 18:56:13 +0000 |
| commit | 870c34f0cfe0678dedcec33770fe4304b60c2e0c (patch) | |
| tree | 46113c7f1c7c847dcceddbb570c39e0262fd6f7b /llvm/lib/CodeGen | |
| parent | eb3219a9c23444361172f9840f2338cc5de0152d (diff) | |
| download | bcm5719-llvm-870c34f0cfe0678dedcec33770fe4304b60c2e0c.tar.gz bcm5719-llvm-870c34f0cfe0678dedcec33770fe4304b60c2e0c.zip | |
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
llvm-svn: 265329
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/TargetRegisterInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetRegisterInfo.cpp b/llvm/lib/CodeGen/TargetRegisterInfo.cpp index 0a7042ac3db..fc88629b5c8 100644 --- a/llvm/lib/CodeGen/TargetRegisterInfo.cpp +++ b/llvm/lib/CodeGen/TargetRegisterInfo.cpp @@ -388,6 +388,15 @@ bool TargetRegisterInfo::needsStackRealignment( return false; } +bool TargetRegisterInfo::regmaskSubsetEqual(const uint32_t *mask0, + const uint32_t *mask1) const { + unsigned N = (getNumRegs()+31) / 32; + for (unsigned I = 0; I < N; ++I) + if ((mask0[I] & mask1[I]) != mask0[I]) + return false; + return true; +} + #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) void TargetRegisterInfo::dumpReg(unsigned Reg, unsigned SubRegIndex, |

