[Mlir-commits] [mlir] [mlir][linalg] do not break outs from block argument (PR #73572)

Okwan Kwon llvmlistbot at llvm.org
Mon Nov 27 16:03:09 PST 2023


================
@@ -1818,6 +1818,11 @@ struct RemoveOutsDependency : public OpRewritePattern<GenericOp> {
         if (sparse_tensor::getSparseTensorEncoding(operandVal.getType()))
           continue;
 
+        // If outs is wired from a block argument, keep the dependency to
+        // prevent the argument from being optimized away.
+        if (isa<BlockArgument>(operandVal))
----------------
okkwon wrote:

I believe we the community needs more discussion about this and make a clear specification how to use a tensor as output. That's going to be lots of work. For now,  the path using `iree.abi.output` and leaving the dependency as is can be a good start to at least have a working flow. 

Since the topic can have multiple different design choices and you have a different scope of concern, it would be better to take the concern and discussion outside of this PR and populate solutions there.

We had an offline discussion and Mahesh will create a separate issue to describe his concern and provide more information. Thanks for the help!

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


More information about the Mlir-commits mailing list