Skip to content

Commit a4001d1

Browse files
author
git apple-llvm automerger
committed
Merge commit 'a4bccf7afdd0' from llvm.org/main into next
2 parents 735ed57 + a4bccf7 commit a4001d1

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

mlir/docs/DeclarativeRewrites.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def OneAttrOp : Op<"one_attr_op"> {
355355
We can write a C++ helper function:
356356

357357
```c++
358-
Attribute createArrayAttr(Builder &builder, Attribute a, Attribute b) {
358+
ArrayAttr createArrayAttr(Builder &builder, Attribute a, Attribute b) {
359359
return builder.getArrayAttr({a, b});
360360
}
361361
```
@@ -405,15 +405,15 @@ def : Pat<(OneAttrOp (NativeCodeCall<"Foo($_self, &$0)"> I32Attr:$val)),
405405
```
406406

407407
In the above, `$_self` is substituted by the defining operation of the first
408-
operand of OneAttrOp. Note that we don't support binding name to NativeCodeCall
409-
in the source pattern. To carry some return values from helper function, put the
408+
operand of OneAttrOp. Note that we don't support binding name to `NativeCodeCall`
409+
in the source pattern. To carry some return values from a helper function, put the
410410
names (constraint is optional) in the parameter list and they will be bound to
411-
the variables with correspoding type. Then these named must be either passed by
412-
reference or a pointer to variable used as argument so that the matched value
411+
the variables with correspoding type. Then these names must be either passed by
412+
reference or pointer to the variable used as argument so that the matched value
413413
can be returned. In the same example, `$val` will be bound to a variable with
414-
`Attribute` type(as `I32Attr`) and the type of the second argument in Foo()
414+
`Attribute` type (as `I32Attr`) and the type of the second argument in `Foo()`
415415
could be `Attribute&` or `Attribute*`. Names with attribute constraints will be
416-
captured as Attributes while everything else will be treated as Value.
416+
captured as `Attribute`s while everything else will be treated as `Value`s.
417417

418418
Positional placeholders will be substituted by the `dag` object parameters at
419419
the `NativeCodeCall` use site. For example, if we define `SomeCall :
@@ -440,13 +440,13 @@ def : Pattern<(TwoResultOp $attr1, $attr2),
440440
441441
```
442442

443-
Use `NativeCodeCallVoid` for case has no return value.
443+
Use `NativeCodeCallVoid` for cases with no return value.
444444

445445
The correct number of returned value specified in NativeCodeCall is important.
446-
It will be used to verify the consistency of the number of result values.
447-
Additionally, `mlir-tblgen` will try to capture the return value of
448-
NativeCodeCall in the generated code so that it will trigger a later compilation
449-
error if a NativeCodeCall that doesn't return a result isn't labeled with 0
446+
It will be used to verify the consistency of the number of return values.
447+
Additionally, `mlir-tblgen` will try to capture the return values of
448+
`NativeCodeCall` in the generated code so that it will trigger a later compilation
449+
error if a `NativeCodeCall` that doesn't return any result isn't labeled with 0
450450
returns.
451451

452452
##### Customizing entire op building
@@ -531,9 +531,9 @@ def ThreeResultOp : Op<"three_result_op"> {
531531
let arguments = (ins ...);
532532
533533
let results = (outs
534-
AnyTensor:$op_output1,
535-
AnyTensor:$op_output2,
536-
AnyTensor:$op_output3
534+
AnyTensor:$output1,
535+
AnyTensor:$output2,
536+
AnyTensor:$output3
537537
);
538538
}
539539
@@ -542,7 +542,7 @@ def : Pattern<(ThreeResultOp:$results ...),
542542
```
543543

544544
In the above pattern we bind `$results` to all the results generated by
545-
`ThreeResultOp` and references its `$input1` and `$input3` later in the result
545+
`ThreeResultOp` and references its `$output1` and `$output3` later in the result
546546
patterns.
547547

548548
We can also bind a symbol and reference one of its specific result at the same
@@ -728,7 +728,7 @@ In the above pattern, the generated `LocDst2Op` will use the matched location of
728728
### `replaceWithValue`
729729

730730
The `replaceWithValue` directive is used to eliminate a matched op by replacing
731-
all of it uses with a captured value. It is of the following syntax:
731+
all of its uses with a captured value. It is of the following syntax:
732732

733733
```tablegen
734734
(replaceWithValue $symbol)

mlir/docs/OpDefinitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ is used. They serve as "hooks" to the enclosing environment. This includes
11111111
information of the current operation.
11121112
* `$_self` will be replaced with the entity this predicate is attached to.
11131113
E.g., `BoolAttr` is an attribute constraint that wraps a
1114-
`CPred<"$_self.isa<BoolAttr>()">`. Then for `F32Attr:$attr`,`$_self` will be
1114+
`CPred<"$_self.isa<BoolAttr>()">`. Then for `BoolAttr:$attr`,`$_self` will be
11151115
replaced by `$attr`. For type constraints, it's a little bit special since
11161116
we want the constraints on each type definition reads naturally and we want
11171117
to attach type constraints directly to an operand/result, `$_self` will be

0 commit comments

Comments
 (0)