[Mlir-commits] [mlir] [mlir][linalg] do not break outs from block argument (PR #73572)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Nov 27 14:03:26 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))
----------------
MaheshRavishankar wrote:
We can do something slightly better here. Check if this value is coming from a `DestinationStyleOpInterface` . If so replace it with the corresponding `init` value of that operation. I you do that you should be able to remove lines 1821 to 1835.
https://github.com/llvm/llvm-project/pull/73572
More information about the Mlir-commits
mailing list