diff options
author | Stephen Lin <stephenwlin@gmail.com> | 2013-04-20 05:14:40 +0000 |
---|---|---|
committer | Stephen Lin <stephenwlin@gmail.com> | 2013-04-20 05:14:40 +0000 |
commit | 456ca048af35163b9f52187e92a23ee0a9f059e8 (patch) | |
tree | f7b4d4711424b927d5b323a9e4ef4d97742beeb4 /include/llvm/IR | |
parent | 5c34e08b9fff9d4df2421e4f41ff15b85f638dd1 (diff) | |
download | llvm-456ca048af35163b9f52187e92a23ee0a9f059e8.tar.gz llvm-456ca048af35163b9f52187e92a23ee0a9f059e8.tar.bz2 llvm-456ca048af35163b9f52187e92a23ee0a9f059e8.tar.xz |
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR')
-rw-r--r-- | include/llvm/IR/Argument.h | 4 | ||||
-rw-r--r-- | include/llvm/IR/Attributes.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/IR/Argument.h b/include/llvm/IR/Argument.h index ef4e4fc7aa..40d61ff685 100644 --- a/include/llvm/IR/Argument.h +++ b/include/llvm/IR/Argument.h @@ -78,6 +78,10 @@ public: /// containing function. bool hasStructRetAttr() const; + /// \brief Return true if this argument has the returned attribute on it in + /// its containing function. + bool hasReturnedAttr() const; + /// \brief Add a Attribute to an argument. void addAttr(AttributeSet AS); diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index f93f28b239..c801436910 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -87,6 +87,7 @@ public: OptimizeForSize, ///< opt_size ReadNone, ///< Function does not access memory ReadOnly, ///< Function only reads from memory + Returned, ///< Return value is always equal to this argument ReturnsTwice, ///< Function can return twice SExt, ///< Sign extended before/after call StackAlignment, ///< Alignment of stack for function (3 bits) |