@@ -79,9 +79,9 @@ When adding a new op, ask:
79
79
80
80
1 . Does it read from or write to the heap or stack? It should probably implement
81
81
` MemoryEffectsOpInterface ` .
82
- 1 . Does these side effects ordered? It should probably set the stage of
83
- side effects to make analysis more accurate.
84
- 1 . Does These side effects act on every single value of resource? It probably
82
+ 1 . Are these side effects ordered? The op should probably set the stage of
83
+ side effects to make analyses more accurate.
84
+ 1 . Do these side effects act on every single value of a resource? It probably
85
85
should set the FullEffect on effect.
86
86
1 . Does it have side effects that must be preserved, like a volatile store or a
87
87
syscall? It should probably implement ` MemoryEffectsOpInterface ` and model
@@ -106,9 +106,9 @@ add side effect correctly.
106
106
107
107
### SIMD compute operation
108
108
109
- If we have a SIMD backend dialect with a "simd.abs" operation, which reads all
109
+ Consider a SIMD backend dialect with a "simd.abs" operation which reads all
110
110
values from the source memref, calculates their absolute values, and writes them
111
- to the target memref.
111
+ to the target memref:
112
112
113
113
``` mlir
114
114
func.func @abs(%source : memref<10xf32>, %target : memref<10xf32>) {
@@ -139,10 +139,10 @@ A typical approach is as follows:
139
139
}
140
140
```
141
141
142
- In the above example, we attach the side effect [ MemReadAt<0, FullEffect>] to
142
+ In the above example, we attach the side effect ` [MemReadAt<0, FullEffect>] ` to
143
143
the source, indicating that the abs operation reads each individual value from
144
144
the source during stage 0. Likewise, we attach the side effect
145
- [ MemWriteAt<1, FullEffect>] to the target, indicating that the abs operation
145
+ ` [MemWriteAt<1, FullEffect>] ` to the target, indicating that the abs operation
146
146
writes to each individual value within the target during stage 1 (after reading
147
147
from the source).
148
148
@@ -174,7 +174,7 @@ A typical approach is as follows:
174
174
}
175
175
```
176
176
177
- In the above example, we attach the side effect [ MemReadAt<0, PartialEffect>] to
177
+ In the above example, we attach the side effect ` [MemReadAt<0, PartialEffect>] ` to
178
178
the source, indicating that the load operation reads parts of values from the
179
179
memref during stage 0. Since side effects typically occur at stage 0 and are
180
- partial by default, we can abbreviate it as " [ MemRead] " .
180
+ partial by default, we can abbreviate it as ` [MemRead] ` .
0 commit comments