[Mlir-commits] [mlir] [mlir] Implement DestinationStyleOpInterface for scf::ForallOp (PR #66981)

Felix Schneider llvmlistbot at llvm.org
Thu Sep 21 10:46:51 PDT 2023


================
@@ -3970,6 +3971,11 @@ struct FoldTensorCastProducerOp
     if (isa<InsertSliceOp>(op.getOperation()))
       return failure();
 
+    // scf::ForallOp also has its own folding logic taking the Types of its
+    // BlockArguments into consideration.
+    if (isa<scf::ForallOp>(op.getOperation()))
+      return failure();
+
----------------
ubfx wrote:

Thank you for pointing that out!

I just tried adding a simple check for `op->getNumRegions() != 0` but this also doesn't work because it excludes all of the `linalgOp`s that are some of the primary targets of this Pattern. How about excluding Ops that have tensor bbArgs, or is this getting too specific?

About the potential Interface - is there a way to implement this so that it doesn't add extra implementation effort to every DPS op?

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


More information about the Mlir-commits mailing list