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

Alan Li llvmlistbot at llvm.org
Wed Sep 10 06:19:02 PDT 2025


================
@@ -680,8 +680,11 @@ void mlir::scf::promote(RewriterBase &rewriter, scf::ForallOp forallOp) {
   SmallVector<Value> results;
   results.reserve(forallOp.getResults().size());
   for (auto &yieldingOp : terminator.getYieldingOps()) {
+    // Skip non-ParallelInsertSliceOp operations
     auto parallelInsertSliceOp =
-        cast<tensor::ParallelInsertSliceOp>(yieldingOp);
+        dyn_cast<tensor::ParallelInsertSliceOp>(yieldingOp);
----------------
lialan wrote:

I believe this needs to be a per-op basis analysis.
One thing we can do is to have a `canPromote` interface method to make a decision here so each can implement its own decision.


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


More information about the Mlir-commits mailing list