@@ -355,7 +355,7 @@ def OneAttrOp : Op<"one_attr_op"> {
355
355
We can write a C++ helper function:
356
356
357
357
``` c++
358
- Attribute createArrayAttr (Builder &builder, Attribute a, Attribute b) {
358
+ ArrayAttr createArrayAttr (Builder &builder, Attribute a, Attribute b) {
359
359
return builder.getArrayAttr({a, b});
360
360
}
361
361
```
@@ -405,15 +405,15 @@ def : Pat<(OneAttrOp (NativeCodeCall<"Foo($_self, &$0)"> I32Attr:$val)),
405
405
```
406
406
407
407
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
410
410
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
413
413
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() `
415
415
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 .
417
417
418
418
Positional placeholders will be substituted by the ` dag ` object parameters at
419
419
the ` NativeCodeCall ` use site. For example, if we define `SomeCall :
@@ -440,13 +440,13 @@ def : Pattern<(TwoResultOp $attr1, $attr2),
440
440
441
441
```
442
442
443
- Use ` NativeCodeCallVoid ` for case has no return value.
443
+ Use ` NativeCodeCallVoid ` for cases with no return value.
444
444
445
445
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
450
450
returns.
451
451
452
452
##### Customizing entire op building
@@ -531,9 +531,9 @@ def ThreeResultOp : Op<"three_result_op"> {
531
531
let arguments = (ins ...);
532
532
533
533
let results = (outs
534
- AnyTensor:$op_output1 ,
535
- AnyTensor:$op_output2 ,
536
- AnyTensor:$op_output3
534
+ AnyTensor:$output1 ,
535
+ AnyTensor:$output2 ,
536
+ AnyTensor:$output3
537
537
);
538
538
}
539
539
@@ -542,7 +542,7 @@ def : Pattern<(ThreeResultOp:$results ...),
542
542
```
543
543
544
544
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
546
546
patterns.
547
547
548
548
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
728
728
### ` replaceWithValue `
729
729
730
730
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:
732
732
733
733
``` tablegen
734
734
(replaceWithValue $symbol)
0 commit comments