@@ -9475,10 +9475,11 @@ This instruction requires several arguments:
9475
9475
from the :ref:`datalayout string<langref_datalayout>` will be used.
9476
9476
#. '``ty``': the type of the call instruction itself which is also the
9477
9477
type of the return value. Functions that return no value are marked
9478
- ``void``.
9478
+ ``void``. The signature is computed based on the return type and argument
9479
+ types.
9479
9480
#. '``fnty``': shall be the signature of the function being invoked. The
9480
9481
argument types must match the types implied by this signature. This
9481
- type can be omitted if the function is not varargs.
9482
+ is only required if the signature specifies a varargs type .
9482
9483
#. '``fnptrval``': An LLVM value containing a pointer to a function to
9483
9484
be invoked. In most cases, this is a direct function invocation, but
9484
9485
indirect ``invoke``'s are just as possible, calling an arbitrary pointer
@@ -9571,10 +9572,11 @@ This instruction requires several arguments:
9571
9572
from the :ref:`datalayout string<langref_datalayout>` will be used.
9572
9573
#. '``ty``': the type of the call instruction itself which is also the
9573
9574
type of the return value. Functions that return no value are marked
9574
- ``void``.
9575
+ ``void``. The signature is computed based on the return type and argument
9576
+ types.
9575
9577
#. '``fnty``': shall be the signature of the function being called. The
9576
9578
argument types must match the types implied by this signature. This
9577
- type can be omitted if the function is not varargs.
9579
+ is only required if the signature specifies a varargs type .
9578
9580
#. '``fnptrval``': An LLVM value containing a pointer to a function to
9579
9581
be called. In most cases, this is a direct function call, but
9580
9582
other ``callbr``'s are just as possible, calling an arbitrary pointer
@@ -13127,10 +13129,11 @@ This instruction requires several arguments:
13127
13129
from the :ref:`datalayout string<langref_datalayout>` will be used.
13128
13130
#. '``ty``': the type of the call instruction itself which is also the
13129
13131
type of the return value. Functions that return no value are marked
13130
- ``void``.
13132
+ ``void``. The signature is computed based on the return type and argument
13133
+ types.
13131
13134
#. '``fnty``': shall be the signature of the function being called. The
13132
13135
argument types must match the types implied by this signature. This
13133
- type can be omitted if the function is not varargs.
13136
+ is only required if the signature specifies a varargs type .
13134
13137
#. '``fnptrval``': An LLVM value containing a pointer to a function to
13135
13138
be called. In most cases, this is a direct function call, but
13136
13139
indirect ``call``'s are just as possible, calling an arbitrary pointer
@@ -13152,6 +13155,16 @@ values. Upon a '``ret``' instruction in the called function, control
13152
13155
flow continues with the instruction after the function call, and the
13153
13156
return value of the function is bound to the result argument.
13154
13157
13158
+ If the callee refers to an intrinsic function, the signature of the call must
13159
+ match the signature of the callee. Otherwise, if the signature of the call
13160
+ does not match the signature of the called function, the behavior is
13161
+ target-specific. For a significant mismatch, this likely results in undefined
13162
+ behavior. LLVM interprocedural optimizations generally only optimize calls
13163
+ where the signature of the caller matches the signature of the callee.
13164
+
13165
+ Note that it is possible for the signatures to mismatch even if a call appears
13166
+ to be a "direct" call, like ``call void @f()``.
13167
+
13155
13168
Example:
13156
13169
""""""""
13157
13170
0 commit comments