Skip to content

Commit 93ba913

Browse files
IanWood1AWoloszyn
authored andcommitted
[Dispatch] Fix return in multiuse fusion (#21536)
Use `continue` instead of `return` because the consumer can still be fused with other producers even if one is a bit extend/truncate. From #21524 (comment) Signed-off-by: Ian Wood <[email protected]>
1 parent 20a1743 commit 93ba913

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/iree/compiler/DispatchCreation/FuseMultiUseElementwiseProducer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ static FailureOr<unsigned> fuseMultiUseProducers(
202202
// by cloning the producer instead of multi-use fusion.
203203
if (!options.intraDispatch &&
204204
IREE::LinalgExt::isBitExtendOp(producer)) {
205-
return;
205+
continue;
206206
}
207207

208208
// 8. Skip bit-truncate-like `producer` ops as we would rather fuse
209209
// these operations with their producers.
210210
if (!options.intraDispatch &&
211211
IREE::LinalgExt::isBitTruncateOp(producer)) {
212-
return;
212+
continue;
213213
}
214214

215215
// 9. All uses from `producer` -> `consumer` need to be fusable.
@@ -225,8 +225,9 @@ static FailureOr<unsigned> fuseMultiUseProducers(
225225
fusableProducer = producer;
226226
break;
227227
}
228-
if (!fusableProducer)
228+
if (!fusableProducer) {
229229
return;
230+
}
230231

231232
// If the `genericOp` is already part of a fusion group, just add the
232233
// the `fusableProducer` to the same group.

0 commit comments

Comments
 (0)