@@ -12780,11 +12780,11 @@ This instruction requires several arguments:
12780
12780
attributes like "disable-tail-calls". The ``musttail`` marker provides these
12781
12781
guarantees:
12782
12782
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
12784
12784
recursive cycle in the call graph.
12785
- #. Arguments with the :ref:`inalloca <attr_inalloca>` or
12785
+ - Arguments with the :ref:`inalloca <attr_inalloca>` or
12786
12786
: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
12788
12788
and the caller and callee both have varargs, then any unprototyped
12789
12789
arguments in register or memory are forwarded to the callee. Similarly,
12790
12790
the return value of the callee is returned to the caller's caller, even
@@ -12795,7 +12795,7 @@ This instruction requires several arguments:
12795
12795
argument may be passed to the callee as a byval argument, which can be
12796
12796
dereferenced inside the callee. For example:
12797
12797
12798
- .. code-block:: llvm
12798
+ .. code-block:: llvm
12799
12799
12800
12800
declare void @take_byval(ptr byval(i64))
12801
12801
declare void @take_ptr(ptr)
@@ -12849,43 +12849,41 @@ This instruction requires several arguments:
12849
12849
ret void
12850
12850
}
12851
12851
12852
-
12853
12852
Calls marked ``musttail`` must obey the following additional rules:
12854
12853
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.
12864
12863
12865
- In addition, if the calling convention is not `swifttailcc` or `tailcc`:
12864
+ In addition, if the calling convention is not `swifttailcc` or `tailcc`:
12866
12865
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.
12871
12870
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`:
12873
12872
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.
12877
12876
12878
12877
Tail call optimization for calls marked ``tail`` is guaranteed to occur if
12879
12878
the following conditions are met:
12880
12879
12881
12880
- Caller and callee both have the calling convention ``fastcc`` or ``tailcc``.
12882
12881
- The call is in tail position (ret immediately follows call and ret
12883
12882
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>`_
12889
12887
12890
12888
#. The optional ``notail`` marker indicates that the optimizers should not add
12891
12889
``tail`` or ``musttail`` markers to the call. It is used to prevent tail
0 commit comments