Skip to content

Commit a2995cb

Browse files
authored
[LangRef] Fix code segment and numbering issue in the 'call' instruction section (#122294)
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.
1 parent c575a7d commit a2995cb

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

llvm/docs/LangRef.rst

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12780,11 +12780,11 @@ This instruction requires several arguments:
1278012780
attributes like "disable-tail-calls". The ``musttail`` marker provides these
1278112781
guarantees:
1278212782

12783-
#. The call will not cause unbounded stack growth if it is part of a
12783+
- The call will not cause unbounded stack growth if it is part of a
1278412784
recursive cycle in the call graph.
12785-
#. Arguments with the :ref:`inalloca <attr_inalloca>` or
12785+
- Arguments with the :ref:`inalloca <attr_inalloca>` or
1278612786
:ref:`preallocated <attr_preallocated>` attribute are forwarded in place.
12787-
#. If the musttail call appears in a function with the ``"thunk"`` attribute
12787+
- If the musttail call appears in a function with the ``"thunk"`` attribute
1278812788
and the caller and callee both have varargs, then any unprototyped
1278912789
arguments in register or memory are forwarded to the callee. Similarly,
1279012790
the return value of the callee is returned to the caller's caller, even
@@ -12795,7 +12795,7 @@ This instruction requires several arguments:
1279512795
argument may be passed to the callee as a byval argument, which can be
1279612796
dereferenced inside the callee. For example:
1279712797

12798-
.. code-block:: llvm
12798+
.. code-block:: llvm
1279912799

1280012800
declare void @take_byval(ptr byval(i64))
1280112801
declare void @take_ptr(ptr)
@@ -12849,43 +12849,41 @@ This instruction requires several arguments:
1284912849
ret void
1285012850
}
1285112851

12852-
1285312852
Calls marked ``musttail`` must obey the following additional rules:
1285412853

12855-
- The call must immediately precede a :ref:`ret <i_ret>` instruction,
12856-
or a pointer bitcast followed by a ret instruction.
12857-
- The ret instruction must return the (possibly bitcasted) value
12858-
produced by the call, undef, or void.
12859-
- The calling conventions of the caller and callee must match.
12860-
- The callee must be varargs iff the caller is varargs. Bitcasting a
12861-
non-varargs function to the appropriate varargs type is legal so
12862-
long as the non-varargs prefixes obey the other rules.
12863-
- The return type must not undergo automatic conversion to an `sret` pointer.
12854+
- The call must immediately precede a :ref:`ret <i_ret>` instruction,
12855+
or a pointer bitcast followed by a ret instruction.
12856+
- The ret instruction must return the (possibly bitcasted) value
12857+
produced by the call, undef, or void.
12858+
- The calling conventions of the caller and callee must match.
12859+
- The callee must be varargs iff the caller is varargs. Bitcasting a
12860+
non-varargs function to the appropriate varargs type is legal so
12861+
long as the non-varargs prefixes obey the other rules.
12862+
- The return type must not undergo automatic conversion to an `sret` pointer.
1286412863

12865-
In addition, if the calling convention is not `swifttailcc` or `tailcc`:
12864+
In addition, if the calling convention is not `swifttailcc` or `tailcc`:
1286612865

12867-
- All ABI-impacting function attributes, such as sret, byval, inreg,
12868-
returned, and inalloca, must match.
12869-
- The caller and callee prototypes must match. Pointer types of parameters
12870-
or return types may differ in pointee type, but not in address space.
12866+
- All ABI-impacting function attributes, such as sret, byval, inreg,
12867+
returned, and inalloca, must match.
12868+
- The caller and callee prototypes must match. Pointer types of parameters
12869+
or return types may differ in pointee type, but not in address space.
1287112870

12872-
On the other hand, if the calling convention is `swifttailcc` or `tailcc`:
12871+
On the other hand, if the calling convention is `swifttailcc` or `tailcc`:
1287312872

12874-
- Only these ABI-impacting attributes attributes are allowed: sret, byval,
12875-
swiftself, and swiftasync.
12876-
- Prototypes are not required to match.
12873+
- Only these ABI-impacting attributes attributes are allowed: sret, byval,
12874+
swiftself, and swiftasync.
12875+
- Prototypes are not required to match.
1287712876

1287812877
Tail call optimization for calls marked ``tail`` is guaranteed to occur if
1287912878
the following conditions are met:
1288012879

1288112880
- Caller and callee both have the calling convention ``fastcc`` or ``tailcc``.
1288212881
- The call is in tail position (ret immediately follows call and ret
1288312882
uses value of call or is void).
12884-
- Option ``-tailcallopt`` is enabled,
12885-
``llvm::GuaranteedTailCallOpt`` is ``true``, or the calling convention
12886-
is ``tailcc``
12887-
- `Platform-specific constraints are
12888-
met. <CodeGenerator.html#tail-call-optimization>`_
12883+
- Option ``-tailcallopt`` is enabled, ``llvm::GuaranteedTailCallOpt`` is
12884+
``true``, or the calling convention is ``tailcc``.
12885+
- `Platform-specific constraints are met.
12886+
<CodeGenerator.html#tail-call-optimization>`_
1288912887

1289012888
#. The optional ``notail`` marker indicates that the optimizers should not add
1289112889
``tail`` or ``musttail`` markers to the call. It is used to prevent tail

0 commit comments

Comments
 (0)