[Mlir-commits] [mlir] [mlir][llvmir] fix docs (PR #71765)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Nov 8 19:59:57 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-mlir-llvm
Author: Maksim Levental (makslevental)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/71765.diff
1 Files Affected:
- (modified) mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td (+7-5)
``````````diff
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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/71765
More information about the Mlir-commits
mailing list