[Mlir-commits] [mlir] [MLIR] Add `InParallelOpInterface` for parallel combining operations (PR #157736)

Mehdi Amini llvmlistbot at llvm.org
Tue Sep 9 12:33:31 PDT 2025


================
@@ -784,8 +784,12 @@ struct RankReducedInsertSliceOp : public OpRewritePattern<InsertOpTy> {
       // The only difference between InsertSliceOp and ParallelInsertSliceOp
       // is the insertion point is just before the ParallelCombiningOp in the
       // parallel case.
-      if (std::is_same<InsertOpTy, tensor::ParallelInsertSliceOp>::value)
-        rewriter.setInsertionPoint(insertSliceOp->getParentOp());
+      if (std::is_same<InsertOpTy, tensor::ParallelInsertSliceOp>::value) {
+        if (auto combiningParent = dyn_cast<ParallelCombiningOpInterface>(
----------------
joker-eph wrote:

Can this cast fail? In which condition? I don't quite get why it is added here.

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


More information about the Mlir-commits mailing list