Skip to content

Commit 62a1a9d

Browse files
River707jpienaar
authored andcommitted
Replace usages of instruction with operation in the g3 documents.
PiperOrigin-RevId: 241037784
1 parent 6f84d34 commit 62a1a9d

12 files changed

+108
-109
lines changed

Diff for: g3doc/Canonicalization.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Some important things to think about w.r.t. canonicalization patterns:
4040

4141
These transformation are applied to all levels of IR:
4242

43-
* Elimination of instructions that have no side effects and have no uses.
43+
* Elimination of operations that have no side effects and have no uses.
4444

4545
* Constant folding - e.g. "(addi 1, 2)" to "3". Constand folding hooks are
4646
specified by operations.
@@ -53,10 +53,10 @@ These transformation are applied to all levels of IR:
5353
These transformations are applied to builtin ops:
5454

5555
* `constant` ops are uniqued and hoisted into the entry block of a function.
56-
* (TODO) Merge `affine.apply` instructions that directly feed each other.
56+
* (TODO) Merge `affine.apply` operations that directly feed each other.
5757

5858
## Standard Ops Canonicalizations
5959

60-
* Shape folding of `alloc` instructions to turn dynamic dimensions into static
60+
* Shape folding of `alloc` operations to turn dynamic dimensions into static
6161
ones.
62-
* Folding `memref_cast` instructions into users where possible.
62+
* Folding `memref_cast` operations into users where possible.

Diff for: g3doc/ConversionToLLVMDialect.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func @qux(!llvm.type<"i32">, !llvm.type<"float">) -> !llvm.type<"{i64, double}">
178178
func @quux(() -> ()) -> (() -> ())
179179
// are converted into pointers to functions
180180
func @quux(!llvm.type<"void ()*">) -> !llvm.type<"void ()*">
181-
// the call flow is handled by the LLVM dialect `call` instruction supporting both
181+
// the call flow is handled by the LLVM dialect `call` operation supporting both
182182
// direct and indirect calls
183183
```
184184

@@ -291,8 +291,8 @@ Accesses to a memref element are transformed into an access to an element of the
291291
buffer pointed to by the descriptor. The position of the element in the buffer
292292
is calculated by linearizing memref indices in row-major order (lexically first
293293
index is the slowest varying, similar to C). The computation of the linear
294-
address is emitted as arithmetic instructions in the LLVM IR dialect. Static
295-
sizes are introduced as constants. Dynamic sizes are extracted from the memref
294+
address is emitted as arithmetic operation in the LLVM IR dialect. Static sizes
295+
are introduced as constants. Dynamic sizes are extracted from the memref
296296
descriptor.
297297

298298
Accesses to zero-dimensional memref (that are interpreted as pointers to the

Diff for: g3doc/Dialects/Affine.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The affine dialect imposes certain restrictions on dimension and symbolic
1010
identifiers to enable powerful analysis and transformation. A symbolic
1111
identifier can be bound to an SSA value that is either an argument to the
1212
function, a value defined at the top level of that function (outside of all
13-
loops and if instructions), the result of a
13+
loops and if operations), the result of a
1414
[`constant` operation](../LangRef.md#'constant'-operation), or the result of an
1515
[`affine.apply` operation](#'affine.apply'-operation) that recursively takes as
1616
arguments any symbolic identifiers. Dimensions may be bound not only to anything
@@ -29,11 +29,11 @@ Syntax:
2929
operation ::= ssa-id `=` `affine.apply` affine-map dim-and-symbol-use-list
3030
```
3131

32-
The `affine.apply` instruction applies an
32+
The `affine.apply` operation applies an
3333
[affine mapping](../LangRef.md#affine-expressions) to a list of SSA values,
3434
yielding a single SSA value. The number of dimension and symbol arguments to
3535
affine.apply must be equal to the respective number of dimensional and symbolic
36-
inputs to the affine mapping; the `affine.apply` instruction always returns one
36+
inputs to the affine mapping; the `affine.apply` operation always returns one
3737
value. The input operands and result must all have 'index' type.
3838

3939
Example:
@@ -53,7 +53,7 @@ Syntax:
5353

5454
``` {.ebnf}
5555
operation ::= `affine.for` ssa-id `=` lower-bound `to` upper-bound
56-
(`step` integer-literal)? `{` inst* `}`
56+
(`step` integer-literal)? `{` op* `}`
5757
5858
lower-bound ::= `max`? affine-map dim-and-symbol-use-list | shorthand-bound
5959
upper-bound ::= `min`? affine-map dim-and-symbol-use-list | shorthand-bound
@@ -113,8 +113,8 @@ func @simple_example(%A: memref<?x?xf32>, %B: memref<?x?xf32>) {
113113
Syntax:
114114

115115
``` {.ebnf}
116-
operation ::= `affine.if` if-inst-cond `{` inst* `}` (`else` `{` inst* `}`)?
117-
if-inst-cond ::= integer-set dim-and-symbol-use-list
116+
operation ::= `affine.if` if-op-cond `{` op* `}` (`else` `{` op* `}`)?
117+
if-op-cond ::= integer-set dim-and-symbol-use-list
118118
```
119119

120120
The `affine.if` operation restricts execution to a subset of the loop iteration

Diff for: g3doc/Dialects/LLVM.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# LLVM IR Dialect
22

33
This dialect wraps the LLVM IR types and instructions into MLIR types and
4-
operations. It provides several additional instructions that are necessary to
4+
operations. It provides several additional operations that are necessary to
55
cover for the differences in the IR structure (e.g., MLIR does not have `phi`
66
operations and LLVM IR does not have a `constant` operation).
77

@@ -101,7 +101,7 @@ Examples:
101101
%1 = "llvm.fdiv"(%a, %b) : (!llvm<"float">, !llvm<"float">) -> !llvm<"float">
102102
```
103103

104-
#### Memory-related instructions
104+
#### Memory-related operations
105105

106106
- `<r> = alloca <size>`
107107
- `<r> = getelementptr <address>, <index> (, <index>)+`
@@ -213,7 +213,7 @@ this behavior by providing a variadic `call` operation for 0- and 1-result
213213
functions. Even though MLIR supports multi-result functions, LLVM IR dialect
214214
disallows them.
215215

216-
The `call` instruction supports both direct and indirect calls. Direct calls
216+
The `call` operation supports both direct and indirect calls. Direct calls
217217
require the `callee` attribute of function type to be present. Otherwise, the
218218
call is considered indirect and expects the function as its first argument.
219219

Diff for: g3doc/Dialects/Vector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ On a GPU one could then map `i`, `j`, `k` to blocks and threads. Notice that the
9494
temporary storage footprint is `3 * 5` values but `3 * 4 * 5` values are
9595
actually transferred betwen `%A` and `%tmp`.
9696

97-
Alternatively, if a notional vector broadcast instruction were available, the
97+
Alternatively, if a notional vector broadcast operation were available, the
9898
lowered code would resemble:
9999

100100
```mlir {.mlir}

Diff for: g3doc/GenericDAGRewriter.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@ class Pattern {
322322
/// returns a None value. On success it a (possibly null) pattern-specific
323323
/// state wrapped in a Some. This state is passed back into its rewrite
324324
/// function if this match is selected.
325-
virtual Optional<PatternState*> match(OperationInst *op) const = 0;
325+
virtual Optional<PatternState*> match(Operation *op) const = 0;
326326
327327
/// Rewrite the IR rooted at the specified operation with the result of
328328
/// this pattern, generating any new operations with the specified
329329
/// rewriter. If an unexpected error is encountered (an internal
330330
/// compiler error), it is emitted through the normal MLIR diagnostic
331331
/// hooks and the IR is left in a valid state.
332-
virtual void rewrite(OperationInst *op, PatternState *state,
332+
virtual void rewrite(Operation *op, PatternState *state,
333333
PatternRewriter &rewriter) const;
334334
};
335335
```
@@ -372,8 +372,8 @@ class PatternMatcher {
372372
// Given a specific operation, see if there is some rewrite that is
373373
// interesting. If so, return success and return the list of new
374374
// operations that were created. If not, return failure.
375-
bool matchAndRewrite(OperationInst *op,
376-
SmallVectorImpl<OperationInst*> &newlyCreatedOps);
375+
bool matchAndRewrite(Operation *op,
376+
SmallVectorImpl<Operation*> &newlyCreatedOps);
377377
};
378378
```
379379

0 commit comments

Comments
 (0)