[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:33:34 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:
Yeah I understand. What I am saying is that this is being "too aggressive". This was added before destination passing style. What this pattern should be doing is that for elementwise operation, if outs is coming from a destination passing style op, then you replace the operand with the corresponding destination operand of the `outs`. In all other cases, it should just "do nothing". So it will also encompass your change, but is "more correct". Currently it is probably changing the semantics of the program too much.
https://github.com/llvm/llvm-project/pull/73572
More information about the Mlir-commits
mailing list