pub struct CallOperation<'c> { /* private fields */ }
Expand description
A call
operation. Call to an LLVM function..
In LLVM IR, functions may return either 0 or 1 value. LLVM IR dialect
implements this behavior by providing a variadic call
operation for 0- and
1-result functions. Even though MLIR supports multi-result functions, LLVM
IR dialect disallows them.
The call
instruction supports both direct and indirect calls. Direct calls
start with a function name (@
-prefixed) and indirect calls start with an
SSA value (%
-prefixed). The direct callee, if present, is stored as a
function attribute callee
. The trailing type list contains the optional
indirect callee type and the MLIR function type, which differs from the
LLVM function type that uses a explicit void type to model functions that do
not return a value.
Examples:
// Direct call without arguments and with one result.
%0 = llvm.call @foo() : () -> (f32)
// Direct call with arguments and without a result.
llvm.call @bar(%0) : (f32) -> ()
// Indirect call with an argument and without a result.
llvm.call %1(%0) : !llvm.ptr, (f32) -> ()
Implementations§
source§impl<'c> CallOperation<'c>
impl<'c> CallOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> CallOperationBuilder<'c>
pub fn builder( context: &'c Context, location: Location<'c> ) -> CallOperationBuilder<'c>
Creates a builder.