[Mlir-commits] [mlir] [mlir][llvmir] fix docs (PR #71765)
Maksim Levental
llvmlistbot at llvm.org
Wed Nov 8 19:59:27 PST 2023
https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/71765
None
>From e3b3dba99d3a95d61ce51ee7356b7de40b1120c5 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Wed, 8 Nov 2023 21:58:42 -0600
Subject: [PATCH] [mlir][llvmir] fix docs
---
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 7928bb940ad8bae..ffb79a196db28ad 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -572,11 +572,12 @@ def LLVM_CallOp : LLVM_MemAccessOpBase<"call",
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`. If the callee is a variadic function, then the
- `callee_type` attribute must carry the function type. 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.
+ function attribute `callee`. For indirect calls, the callee is of `!llvm.ptr` type
+ and is stored as the first value in `callee_operands`. If the callee is a variadic
+ function, then the `callee_type` attribute must carry the function type. 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:
@@ -588,6 +589,7 @@ def LLVM_CallOp : LLVM_MemAccessOpBase<"call",
llvm.call @bar(%0) : (f32) -> ()
// Indirect call with an argument and without a result.
+ %1 = llvm.mlir.addressof @foo : !llvm.ptr
llvm.call %1(%0) : !llvm.ptr, (f32) -> ()
// Direct variadic call.
More information about the Mlir-commits
mailing list