aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/LangRef.rst
diff options
context:
space:
mode:
authorweiguozhi <57237827+weiguozhi@users.noreply.github.com>2024-02-05 13:28:43 -0800
committerGitHub <noreply@github.com>2024-02-05 13:28:43 -0800
commitc166a43c6e6157b1309ea757324cc0a71c078e66 (patch)
tree4c71f49965fe31945172486acd47adee546043ee /llvm/docs/LangRef.rst
parent76706090c2f672ae933798292bfa889f9e3dac3d (diff)
downloadllvm-c166a43c6e6157b1309ea757324cc0a71c078e66.zip
llvm-c166a43c6e6157b1309ea757324cc0a71c078e66.tar.gz
llvm-c166a43c6e6157b1309ea757324cc0a71c078e66.tar.bz2
New calling convention preserve_none (#76868)
The new experimental calling convention preserve_none is the opposite side of existing preserve_all. It tries to preserve as few general registers as possible. So all general registers are caller saved registers. It can also uses more general registers to pass arguments. This attribute doesn't impact floating-point registers. Floating-point registers still follow the c calling convention. Currently preserve_none is supported on X86-64 only. It changes the c calling convention in following fields: * RSP and RBP are the only preserved general registers, all other general registers are caller saved registers. * We can use [RDI, RSI, RDX, RCX, R8, R9, R11, R12, R13, R14, R15, RAX] to pass arguments. It can improve the performance of hot tailcall chain, because many callee saved registers' save/restore instructions can be removed if the tail functions are using preserve_none. In my experiment in protocol buffer, the parsing functions are improved by 3% to 10%.
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r--llvm/docs/LangRef.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 96bdba5..fd2e3aa 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -421,6 +421,13 @@ added in the future:
This calling convention, like the `PreserveMost` calling convention, will be
used by a future version of the ObjectiveC runtime and should be considered
experimental at this time.
+"``preserve_nonecc``" - The `PreserveNone` calling convention
+ This calling convention doesn't preserve any general registers. So all
+ general registers are caller saved registers. It also uses all general
+ registers to pass arguments. This attribute doesn't impact non-general
+ purpose registers (e.g. floating point registers, on X86 XMMs/YMMs).
+ Non-general purpose registers still follow the standard c calling
+ convention. Currently it is for x86_64 only.
"``cxx_fast_tlscc``" - The `CXX_FAST_TLS` calling convention for access functions
Clang generates an access function to access C++-style TLS. The access
function generally has an entry block, an exit block and an initialization