@@ -310,51 +310,61 @@ def FuseIntoContainingOp :
310
310
["allowsRepeatedHandleOperands"]>,
311
311
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
312
312
ReportTrackingListenerFailuresOpTrait]> {
313
- let summary = "Fuse a producer into a containing operation.";
313
+ let summary = "Fuse a target into a containing operation.";
314
314
315
315
let description = [{
316
- Fuses the `producer_op ` into the `containing_op`.
316
+ Fuses the `target_op ` into the `containing_op`.
317
317
Returns a handle to the fused ops and the `new_containing_op`.
318
318
319
- The producer is typically a slice of a tileable op (i.e., implements
320
- TilingInterface). In that case, this transform computes the accessed
321
- producer slice inside of the containing op ("tile and fuse") and if required,
322
- creates a new containing op with outputs from the fused producer. Otherwise,
323
- the entire producer is cloned inside the containing op ("clone and fuse").
319
+ This operation supports fusion of producer or fusion of consumer. We will
320
+ refer to the value connecting the containing operation and the target
321
+ operation as the "bridge" below.
322
+
323
+ When fuse producer, the bridge is typically a slice of a tileable op (i.e.,
324
+ implements TilingInterface). In that case, this transform computes the
325
+ accessed bridge slice inside of the containing op ("tile and fuse") and
326
+ if required, creates a new containing op with outputs from the fused target.
327
+ Otherwise, the entire target is cloned inside the containing op ("clone
328
+ and fuse").
329
+
330
+ When fuse consumer, the bridge is the result of containing op and a operand
331
+ of a tileable op (i.e., implements TilingInterface). In this case, this
332
+ transform computes the access bridge slice inside the containing op ("tile
333
+ and fuse") and creates a new containing op with consumer's output.
324
334
325
335
The containing op handle must be associated with exactly one payload op. The
326
- producer op handle may be associated with multiple payload ops. This
327
- transform fuses producers one-by-one, always picking an unspecified producer
336
+ target op handle may be associated with multiple payload ops. This
337
+ transform fuses targets one-by-one, always picking an unspecified target
328
338
that has at least one use inside the containing op among the
329
- producers . A producer can be listed multiple times in the handle.
339
+ targets . A target can be listed multiple times in the handle.
330
340
331
- Note: If a producer has multiple uses inside the containing op, it is
341
+ Note: If a target has multiple uses inside the containing op, it is
332
342
currently tiled and/or cloned multiple times into the containing op.
333
343
TODO: Reuse already fused OpResults instead of tiling/cloning a second time
334
- when possible. Fuse producers according to a topological sorting to achieve
344
+ when possible. Fuse targets according to a topological sorting to achieve
335
345
the largest amount of reuse.
336
346
337
347
#### Return modes
338
348
339
- If at least one producer could not be fused, this operation produces a
349
+ If at least one target could not be fused, this operation produces a
340
350
silenceable failure. This is the case when tiling fails or when no
341
- producer op could be found among the remaining producers that has at least
342
- one use within the containing op. I.e., "producers " that are not consumed
351
+ target op could be found among the remaining targets that has at least
352
+ one use within the containing op. I.e., "targets " that are not consumed
343
353
within the containing op are rejected by this operation.
344
354
345
- This operation consumes the producer handle.
355
+ This operation consumes the target handle.
346
356
This operation only reads the containing op handle.
347
357
}];
348
358
349
- let arguments = (ins TransformHandleTypeInterface:$producer_op ,
359
+ let arguments = (ins TransformHandleTypeInterface:$target_op ,
350
360
TransformHandleTypeInterface:$containing_op);
351
361
let results = (outs TransformHandleTypeInterface:$fused_op,
352
362
TransformHandleTypeInterface:$new_containing_op);
353
- let assemblyFormat = "$producer_op `into` $containing_op attr-dict "
363
+ let assemblyFormat = "$target_op `into` $containing_op attr-dict "
354
364
" `:` functional-type(operands, results)";
355
365
356
366
let builders = [
357
- OpBuilder<(ins "Value":$producerOp , "Value":$containingOp)>
367
+ OpBuilder<(ins "Value":$targetOp , "Value":$containingOp)>
358
368
];
359
369
}
360
370
0 commit comments