From b8bd232a3da38b11bb0b848ad2bd18d57319b9dc Mon Sep 17 00:00:00 2001 From: Stephen Lin Date: Sat, 20 Apr 2013 05:14:40 +0000 Subject: Add CodeGen support for functions that always return arguments via a new parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter). llvm-svn: 179925 --- llvm/docs/LangRef.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'llvm/docs') diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 905053fef0b..7dafbb98779 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -719,7 +719,17 @@ Currently, only the following parameter attributes are defined: ``nest`` This indicates that the pointer parameter can be excised using the :ref:`trampoline intrinsics `. This is not a valid - attribute for return values. + attribute for return values and can only be applied to one parameter. + +``returned`` + This indicates that the value of the function always returns the value + of the parameter as its return value. This is an optimization hint to + the code generator when generating the caller, allowing tail call + optimization and omission of register saves and restores in some cases; + it is not checked or enforced when generating the callee. The parameter + and the function return type must be valid operands for the + :ref:`bitcast instruction `. This is not a valid attribute for + return values and can only be applied to one parameter. .. _gc: -- cgit v1.2.3