[Mlir-commits] [mlir] 4b7dafd - [mlir]: Clarify docs for external OpTrait::FunctionLike ops
Alex Zinenko
llvmlistbot at llvm.org
Wed Oct 21 09:08:18 PDT 2020
Author: Frej Drejhammar
Date: 2020-10-21T18:08:10+02:00
New Revision: 4b7dafd9046f0ceaadacaafe0ea4a1fb00cf70a5
URL: https://github.com/llvm/llvm-project/commit/4b7dafd9046f0ceaadacaafe0ea4a1fb00cf70a5
DIFF: https://github.com/llvm/llvm-project/commit/4b7dafd9046f0ceaadacaafe0ea4a1fb00cf70a5.diff
LOG: [mlir]: Clarify docs for external OpTrait::FunctionLike ops
The documentation claims that an op with the trait FunctionLike has a
single region containing the blocks that corresponding to the body of
the function. It then goes on to say that the absence of a region
corresponds to an external function when, in fact, this is represented
by a single empty region. This patch changes the wording in the
documentation to match the implementation.
Signed-off-by: Frej Drejhammar <frej.drejhammar at gmail.com>
Co-authored-by: Frej Drejhammar <frej.drejhammar at gmail.com>
Co-authored-by: Klas Segeljakt <klasseg at kth.se>
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D89868
Added:
Modified:
mlir/docs/Traits.md
mlir/include/mlir/IR/FunctionSupport.h
Removed:
################################################################################
diff --git a/mlir/docs/Traits.md b/mlir/docs/Traits.md
index 8b1cf0a03b99c..b8debb7d275fd 100644
--- a/mlir/docs/Traits.md
+++ b/mlir/docs/Traits.md
@@ -249,7 +249,7 @@ particular:
- Ops must be symbols, i.e. also have the `Symbol` trait;
- Ops have a single region with multiple blocks that corresponds to the body
of the function;
-- the absence of a region corresponds to an external function;
+- An op with a single empty region corresponds to an external function;
- arguments of the first block of the region are treated as function
arguments;
- they can have argument and result attributes that are stored in dictionary
diff --git a/mlir/include/mlir/IR/FunctionSupport.h b/mlir/include/mlir/IR/FunctionSupport.h
index 3d467cd4f3642..7756761c2a523 100644
--- a/mlir/include/mlir/IR/FunctionSupport.h
+++ b/mlir/include/mlir/IR/FunctionSupport.h
@@ -79,7 +79,7 @@ namespace OpTrait {
/// - Ops must be symbols, i.e. also have the `Symbol` trait;
/// - Ops have a single region with multiple blocks that corresponds to the body
/// of the function;
-/// - the absence of a region corresponds to an external function;
+/// - An op with a single empty region corresponds to an external function;
/// - leading arguments of the first block of the region are treated as function
/// arguments;
/// - they can have argument attributes that are stored in a dictionary
More information about the Mlir-commits
mailing list