[PATCH] D22203: Update the LangRef description of the 'returned' attribute
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 10 14:04:54 PDT 2016
hfinkel created this revision.
hfinkel added reviewers: majnemer, chandlerc, dberlin, reames.
hfinkel added a subscriber: llvm-commits.
Herald added subscribers: mcrosier, dschuff, jfb.
The description of the 'returned' attribute says that it is only used when optimizing the function itself, but not the callee. This is already not quite right (at least for the WebAssembly backend: lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp), and I'd like to make the optimizer smarter about looking through functions with returned arguments (generally, but motivated by my llvm.noalias work). As David pointed out in the review of D22202, this will require updating the LangRef.
@@ -1062,10 +1062,10 @@
This indicates that the function always returns the argument 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 <i_bitcast>`. This is not a
- valid attribute for return values and can only be applied to one parameter.
+ and restores in some cases; it can also be used when optimizing the callee.
+ The parameter and the function return type must be valid operands for the
+ :ref:`bitcast instruction <i_bitcast>`. This is not a valid attribute for
+ return values and can only be applied to one parameter.
This indicates that the parameter or return pointer is not null. This
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1097 bytes
Desc: not available
More information about the llvm-commits