[Mlir-commits] [mlir] [MLIR] [Transforms] Let lowerToLoopsUsingSCFForOp delete target op, fixes #83252 (PR #83256)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Feb 28 04:21:00 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-scf

Author: None (lhunloh)

<details>
<summary>Changes</summary>

The function mlir::scf::lowerToLoopsUsingSCFForOp was not deleting its (structured) target op, resulting in IR with the expected loop nest in front of the still remaining (structured) op, e.g. a linalg.matmul.

This would fix issue #<!-- -->83252

---
Full diff: https://github.com/llvm/llvm-project/pull/83256.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp (+1) 


``````````diff
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 1a84a59ddb69df..e1e9be858b251e 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -1133,5 +1133,6 @@ mlir::scf::lowerToLoopsUsingSCFForOp(RewriterBase &rewriter,
   if (failed(op.generateScalarImplementation(rewriter, op.getLoc(), ivs))) {
     return failure();
   }
+  rewriter.eraseOp(op);
   return loops;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/83256


More information about the Mlir-commits mailing list