[TableGen] Clean up comments regarding op and result
authorLei Zhang <antiagainst@google.com>
Mon, 22 Apr 2019 21:56:54 +0000 (14:56 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:02:08 +0000 (22:02 -0700)
    An op can have multiple results. Being explicit that we are binding to the
    whole op instead of one of the results. A way to bind to a specific result
    is yet to come.

--

PiperOrigin-RevId: 244741137

mlir/include/mlir/IR/OpBase.td
mlir/tools/mlir-tblgen/RewriterGen.cpp

index 8e9fb57..e38d658 100644 (file)
@@ -777,14 +777,14 @@ def outs;
 // The signature of the builder is always
 //
 // ```c++
-// static void build(Builder *builder, OperationState *result,
+// static void build(Builder *builder, OperationState *state,
 //                   <other-parameters>...) {
 //   <body>...
 // }
 // ```
 //
 // To define a custom builder, the parameter list (*including* the `Builder
-// *builder, OperationState *result` part) and body should be passed in
+// *builder, OperationState *state` part) and body should be passed in
 // as separate template arguments to this class. This is because we generate
 // op declaration and definition into separate files. If an empty string is
 // passed in for `body`, then *only* the builder declaration will be
@@ -942,21 +942,21 @@ def addBenefit;
 //
 // In the result pattern, `argN` can be used to refer to a previously bound
 // name, with potential transformations (e.g., using tAttr, etc.). `argN` can
-// itself be nested DAG node. We can also bound names to op results to reference
+// itself be nested DAG node. We can also bound names to ops to reference
 // them later in other result patterns.
 //
 // For example,
 //
 // ```
-// def : Pattern<(OneResultOp1:$res1 $arg0, $arg1),
-//               [(OneResultOp2:$res2 $arg0, $arg1),
-//                (OneResultOp3 $res2 (OneResultOp4))],
-//               [(IsStaticShapeTensorTypePred $res1)]>;
+// def : Pattern<(OneResultOp1:$op1 $arg0, $arg1),
+//               [(OneResultOp2:$op2 $arg0, $arg1),
+//                (OneResultOp3 $op2 (OneResultOp4))],
+//               [(IsStaticShapeTensorTypePred $op1)]>;
 // ```
 //
 // `$argN` is bound to the `OneResultOp1`'s N-th argument and used later to
-// build `OneResultOp2`. `$res1` is bound to `OneResultOp1`'s result and used to
-// check whether the result's shape is static. `$res2` is bound to the result of
+// build `OneResultOp2`. `$op1` is bound to `OneResultOp1` and used to
+// check whether the result's shape is static. `$op2` is bound to
 // `OneResultOp2` and used to build `OneResultOp3`.
 class Pattern<dag source, list<dag> results, list<dag> preds = [],
   dag benefitAdded = (addBenefit 0)> {
@@ -1009,8 +1009,8 @@ class NativeCodeCall<string expr> {
 // Common directives
 //===----------------------------------------------------------------------===//
 
-// Directive used in result pattern to indicate that no new result op are
-// generated, so to replace the matched DAG with an existing SSA value.
+// Directive used in result pattern to indicate that no new op are generated,
+// so to replace the matched DAG with an existing SSA value.
 def replaceWithValue;
 
 // Directive used in result pattern to indicate that no replacement is generated
index bbc961f..dad3035 100644 (file)
@@ -57,8 +57,8 @@ static Twine getBoundSymbol(const StringRef &symbol) {
 namespace {
 // A class for resolving symbols bound in patterns.
 //
-// Symbols can be bound to op arguments/results in the source pattern and op
-// results in result patterns. For example, in
+// Symbols can be bound to op arguments and ops in the source pattern and ops
+// in result patterns. For example, in
 //
 // ```
 // def : Pattern<(SrcOp:$op1 $arg0, %arg1),
@@ -72,7 +72,7 @@ namespace {
 // values.
 //
 // Note that we also generate local variables for unnamed DAG nodes, like
-// `(ResOp3)` in the above. Since we don't bind a symbol to the result, the
+// `(ResOp3)` in the above. Since we don't bind a symbol to the op, the
 // generated local variable will be implicitly named. Those implicit names are
 // not tracked in this class.
 class PatternSymbolResolver {