[llvm-commits] CVS: llvm/docs/LangRef.html
Chris Lattner
lattner at cs.uiuc.edu
Thu May 5 22:47:51 PDT 2005
Changes in directory llvm/docs:
LangRef.html updated: 1.98 -> 1.99
---
Log message:
Add info on new 'tail' marker
---
Diffs of the changes: (+38 -12)
LangRef.html | 50 ++++++++++++++++++++++++++++++++++++++------------
1 files changed, 38 insertions(+), 12 deletions(-)
Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.98 llvm/docs/LangRef.html:1.99
--- llvm/docs/LangRef.html:1.98 Wed May 4 09:58:31 2005
+++ llvm/docs/LangRef.html Fri May 6 00:47:36 2005
@@ -2041,26 +2041,43 @@
<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_call">'<tt>call</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+ <a name="i_call">'<tt>call</tt>' Instruction</a>
+</div>
+
<div class="doc_text">
+
<h5>Syntax:</h5>
-<pre> <result> = call <ty>* <fnptrval>(<param list>)<br></pre>
+<pre>
+ <result> = [tail] call <ty>* <fnptrval>(<param list>)
+</pre>
+
<h5>Overview:</h5>
+
<p>The '<tt>call</tt>' instruction represents a simple function call.</p>
+
<h5>Arguments:</h5>
+
<p>This instruction requires several arguments:</p>
+
<ol>
<li>
- <p>'<tt>ty</tt>': shall be the signature of the pointer to function
-value being invoked. The argument types must match the types implied
-by this signature.</p>
+ <p>The "tail" marker indicates whether the callee function accesses any
+ allocas or varargs in the caller. If the "tail" marker is present, the
+ function call is eligible for tail call optimization. Note that calls may
+ be marked "tail" even if they do not occur before a <a
+ href="#i_ret"><tt>ret</tt></a> instruction.
+ </li>
+ <li>
+ <p>'<tt>ty</tt>': shall be the signature of the pointer to function value
+ being invoked. The argument types must match the types implied by this
+ signature.</p>
</li>
<li>
- <p>'<tt>fnptrval</tt>': An LLVM value containing a pointer to a
-function to be invoked. In most cases, this is a direct function
-invocation, but indirect <tt>call</tt>s are just as possible,
-calling an arbitrary pointer to function values.</p>
+ <p>'<tt>fnptrval</tt>': An LLVM value containing a pointer to a function to
+ be invoked. In most cases, this is a direct function invocation, but
+ indirect <tt>call</tt>s are just as possible, calling an arbitrary pointer
+ to function values.</p>
</li>
<li>
<p>'<tt>function args</tt>': argument list whose types match the
@@ -2070,7 +2087,9 @@
arguments can be specified.</p>
</li>
</ol>
+
<h5>Semantics:</h5>
+
<p>The '<tt>call</tt>' instruction is used to cause control flow to
transfer to a specified function, with its incoming arguments bound to
the specified values. Upon a '<tt><a href="#i_ret">ret</a></tt>'
@@ -2078,8 +2097,15 @@
instruction after the function call, and the return value of the
function is bound to the result argument. This is a simpler case of
the <a href="#i_invoke">invoke</a> instruction.</p>
+
<h5>Example:</h5>
-<pre> %retval = call int %test(int %argc)<br> call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);<br></pre>
+
+<pre>
+ %retval = call int %test(int %argc)
+ call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
+ %X = tail call int %foo()
+</pre>
+
</div>
<!-- _______________________________________________________________________ -->
@@ -3173,7 +3199,7 @@
<a href="mailto:sabre at nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
- Last modified: $Date: 2005/05/04 14:58:31 $
+ Last modified: $Date: 2005/05/06 05:47:36 $
</address>
</body>
</html>
More information about the llvm-commits
mailing list