[PATCH] D78209: [MLIR] Fix fusion of linalg.indexed_generic producer into tiled (Indexed)GenericOp.
Uday Bondhugula via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 09:17:04 PDT 2020
bondhugula added inline comments.
================
Comment at: mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp:114
+ Value newIndex = b.create<AddIOp>(indexedGenericOp.getLoc(), oldIndex,
+ loopRanges[i].offset);
+ for (auto &use : oldIndex.getUses()) {
----------------
Please add a comment here on the replacement.
================
Comment at: mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp:115-119
+ for (auto &use : oldIndex.getUses()) {
+ if (use.getOwner() == newIndex.getDefiningOp())
+ continue;
+ use.set(newIndex);
+ }
----------------
Could you just use `replaceAllUsesExcept(oldIndex, newIndex, {newIndexOp}` for this entire six lines? It's just needs to be exposed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78209/new/
https://reviews.llvm.org/D78209
More information about the llvm-commits
mailing list