[llvm] [LangRef] Fix code segment and numbering issue in the 'call' instruction section (PR #122294)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 07:16:18 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Ayokunle Amodu (ayokunle321)
<details>
<summary>Changes</summary>
Fixes issue #<!-- -->122084.
Under "Arguments" in the 'call' instruction section, there was some text included in the code segment so I edited it out. Also fixed the numbering issue in that section.
---
Full diff: https://github.com/llvm/llvm-project/pull/122294.diff
1 Files Affected:
- (modified) llvm/docs/LangRef.rst (+26-28)
``````````diff
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 7e01331b20c570..e4244a1c763dc4 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -12759,11 +12759,11 @@ This instruction requires several arguments:
attributes like "disable-tail-calls". The ``musttail`` marker provides these
guarantees:
- #. The call will not cause unbounded stack growth if it is part of a
+ - The call will not cause unbounded stack growth if it is part of a
recursive cycle in the call graph.
- #. Arguments with the :ref:`inalloca <attr_inalloca>` or
+ - Arguments with the :ref:`inalloca <attr_inalloca>` or
:ref:`preallocated <attr_preallocated>` attribute are forwarded in place.
- #. If the musttail call appears in a function with the ``"thunk"`` attribute
+ - If the musttail call appears in a function with the ``"thunk"`` attribute
and the caller and callee both have varargs, then any unprototyped
arguments in register or memory are forwarded to the callee. Similarly,
the return value of the callee is returned to the caller's caller, even
@@ -12774,7 +12774,7 @@ This instruction requires several arguments:
argument may be passed to the callee as a byval argument, which can be
dereferenced inside the callee. For example:
-.. code-block:: llvm
+ .. code-block:: llvm
declare void @take_byval(ptr byval(i64))
declare void @take_ptr(ptr)
@@ -12828,31 +12828,30 @@ This instruction requires several arguments:
ret void
}
-
Calls marked ``musttail`` must obey the following additional rules:
- - The call must immediately precede a :ref:`ret <i_ret>` instruction,
- or a pointer bitcast followed by a ret instruction.
- - The ret instruction must return the (possibly bitcasted) value
- produced by the call, undef, or void.
- - The calling conventions of the caller and callee must match.
- - The callee must be varargs iff the caller is varargs. Bitcasting a
- non-varargs function to the appropriate varargs type is legal so
- long as the non-varargs prefixes obey the other rules.
- - The return type must not undergo automatic conversion to an `sret` pointer.
+ - The call must immediately precede a :ref:`ret <i_ret>` instruction,
+ or a pointer bitcast followed by a ret instruction.
+ - The ret instruction must return the (possibly bitcasted) value
+ produced by the call, undef, or void.
+ - The calling conventions of the caller and callee must match.
+ - The callee must be varargs iff the caller is varargs. Bitcasting a
+ non-varargs function to the appropriate varargs type is legal so
+ long as the non-varargs prefixes obey the other rules.
+ - The return type must not undergo automatic conversion to an `sret` pointer.
- In addition, if the calling convention is not `swifttailcc` or `tailcc`:
+ In addition, if the calling convention is not `swifttailcc` or `tailcc`:
- - All ABI-impacting function attributes, such as sret, byval, inreg,
- returned, and inalloca, must match.
- - The caller and callee prototypes must match. Pointer types of parameters
- or return types may differ in pointee type, but not in address space.
+ - All ABI-impacting function attributes, such as sret, byval, inreg,
+ returned, and inalloca, must match.
+ - The caller and callee prototypes must match. Pointer types of parameters
+ or return types may differ in pointee type, but not in address space.
- On the other hand, if the calling convention is `swifttailcc` or `tailcc`:
+ On the other hand, if the calling convention is `swifttailcc` or `tailcc`:
- - Only these ABI-impacting attributes attributes are allowed: sret, byval,
- swiftself, and swiftasync.
- - Prototypes are not required to match.
+ - Only these ABI-impacting attributes attributes are allowed: sret, byval,
+ swiftself, and swiftasync.
+ - Prototypes are not required to match.
Tail call optimization for calls marked ``tail`` is guaranteed to occur if
the following conditions are met:
@@ -12860,11 +12859,10 @@ This instruction requires several arguments:
- Caller and callee both have the calling convention ``fastcc`` or ``tailcc``.
- The call is in tail position (ret immediately follows call and ret
uses value of call or is void).
- - Option ``-tailcallopt`` is enabled,
- ``llvm::GuaranteedTailCallOpt`` is ``true``, or the calling convention
- is ``tailcc``
- - `Platform-specific constraints are
- met. <CodeGenerator.html#tail-call-optimization>`_
+ - Option ``-tailcallopt`` is enabled, ``llvm::GuaranteedTailCallOpt`` is
+ ``true``, or the calling convention is ``tailcc``.
+ - `Platform-specific constraints are met.
+ <CodeGenerator.html#tail-call-optimization>`_
#. The optional ``notail`` marker indicates that the optimizers should not add
``tail`` or ``musttail`` markers to the call. It is used to prevent tail
``````````
</details>
https://github.com/llvm/llvm-project/pull/122294
More information about the llvm-commits
mailing list