@@ -146,7 +146,7 @@ def LoopPeelOp : Op<Transform_Dialect, "loop.peel",
146
146
let summary = "Peels the first or last iteration of the loop";
147
147
let description = [{
148
148
Rewrite the given loop with a main loop and a partial (first or last) loop.
149
- When the `peelFront` option is set as true, the first iteration is peeled off.
149
+ When the `peelFront` option is set to true, the first iteration is peeled off.
150
150
Otherwise, updates the given loop so that its step evenly divides its range and puts
151
151
the remaining iteration into a separate loop or a conditional.
152
152
@@ -156,18 +156,20 @@ def LoopPeelOp : Op<Transform_Dialect, "loop.peel",
156
156
#### Return modes
157
157
158
158
This operation ignores non-scf::ForOp ops and drops them in the return.
159
-
160
- When `peelFront` is true, this operation returns two scf::ForOp Ops, the
161
- first scf::ForOp corresponds to the first iteration of the loop which can
162
- be canonicalized away in the following optimization. The second loop Op
163
- contains the remaining iteration, and the new lower bound is the original
164
- lower bound plus the number of steps.
165
-
166
- When `peelFront` is not true, this operation returns two scf::ForOp Ops, with the first
167
- scf::ForOp satisfying: "the loop trip count is divisible by the step".
168
- The second loop Op contains the remaining iteration. Note that even though the
169
- Payload IR modification may be performed in-place, this operation consumes
170
- the operand handle and produces a new one.
159
+ The op returns two loops, the peeled loop which has trip count divisible
160
+ by the step, and the remainder loop.
161
+
162
+ When `peelFront` is true, the first result (remainder loop) executes all
163
+ but the first iteration of the target loop. The second result (peeled
164
+ loop) corresponds to the first iteration of the loop which can be
165
+ canonicalized away in the following optimizations.
166
+
167
+ When `peelFront` is false, the first result (peeled loop) is the portion
168
+ of the target loop with the highest upper bound that is divisible by the
169
+ step. The second result (remainder loop) contains the remaining iterations.
170
+
171
+ Note that even though the Payload IR modification may be performed
172
+ in-place, this operation consumes the operand handle and produces a new one.
171
173
172
174
#### Return Modes
173
175
0 commit comments