[CXX TLS calling convention] Add CXX TLS calling convention.
authorManman Ren <manman.ren@gmail.com>
Fri, 4 Dec 2015 17:40:13 +0000 (17:40 +0000)
committerManman Ren <manman.ren@gmail.com>
Fri, 4 Dec 2015 17:40:13 +0000 (17:40 +0000)
commitcd2103de5a0dcbe429010509d91d7648aaca6f59
treefa9fe4bb5aa63740761f858f2c3cd5c7d700eaa6
parent2a3cc32f7191837dc796338f42d9d75d188b4ce6
[CXX TLS calling convention] Add CXX TLS calling convention.

This commit adds a new target-independent calling convention for C++ TLS
access functions. It aims to minimize overhead in the caller by perserving as
many registers as possible.

The target-specific implementation for X86-64 is defined as following:
  Arguments are passed as for the default C calling convention
  The same applies for the return value(s)
  The callee preserves all GPRs - except RAX and RDI

The access function makes C-style TLS function calls in the entry and exit
block, C-style TLS functions save a lot more registers than normal calls.
The added calling convention ties into the existing implementation of the
C-style TLS functions, so we can't simply use existing calling conventions
such as preserve_mostcc.

rdar://9001553

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254737 91177308-0d34-0410-b5e6-96231b3b80d8
docs/BitCodeFormat.rst
docs/LangRef.rst
include/llvm/IR/CallingConv.h
lib/AsmParser/LLLexer.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLToken.h
lib/IR/AsmWriter.cpp
lib/Target/X86/X86RegisterInfo.cpp
test/CodeGen/X86/cxx_tlscc64.ll [new file with mode: 0644]