Skip to content

Commit 307cc49

Browse files
author
MaheshRavishankar
committed
[mlir][Linalg] Add interface method to Linalg ops to allow setting the output operand.
Differential Revision: https://reviews.llvm.org/D113522
1 parent fb1a203 commit 307cc49

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,19 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
410410
return &this->getOperation()->getOpOperand(getNumInputs() + i);
411411
}]
412412
>,
413+
InterfaceMethod<
414+
/*desc=*/[{
415+
Set the `i`-th output operand.
416+
}],
417+
/*retTy=*/"void",
418+
/*methodName=*/"setOutputOperand",
419+
/*args=*/(ins "int64_t":$i, "Value":$value),
420+
/*methodBody=*/"",
421+
/*defaultImplementation=*/[{
422+
assert(i >= 0 && i < getNumOutputs());
423+
this->getOperation()->setOperand(getNumInputs() + i, value);
424+
}]
425+
>,
413426
InterfaceMethod<
414427
/*desc=*/[{
415428
Return the subset of output operands that are of buffer type.

0 commit comments

Comments
 (0)