[Mlir-commits] [mlir] 307cc49 - [mlir][Linalg] Add interface method to Linalg ops to allow setting the output operand.

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Nov 10 09:01:06 PST 2021


Author: MaheshRavishankar
Date: 2021-11-10T09:00:59-08:00
New Revision: 307cc490e7d48672a3d6a70dd5d431e8598fd6ee

URL: https://github.com/llvm/llvm-project/commit/307cc490e7d48672a3d6a70dd5d431e8598fd6ee
DIFF: https://github.com/llvm/llvm-project/commit/307cc490e7d48672a3d6a70dd5d431e8598fd6ee.diff

LOG: [mlir][Linalg] Add interface method to Linalg ops to allow setting the output operand.

Differential Revision: https://reviews.llvm.org/D113522

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
index c305ff0f619a2..66745096ded34 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -410,6 +410,19 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
         return &this->getOperation()->getOpOperand(getNumInputs() + i);
       }]
     >,
+    InterfaceMethod<
+      /*desc=*/[{
+        Set the `i`-th output operand.
+      }],
+      /*retTy=*/"void",
+      /*methodName=*/"setOutputOperand",
+      /*args=*/(ins "int64_t":$i, "Value":$value),
+      /*methodBody=*/"",
+      /*defaultImplementation=*/[{
+        assert(i >= 0 && i < getNumOutputs());
+        this->getOperation()->setOperand(getNumInputs() + i, value);
+      }]
+    >,
     InterfaceMethod<
       /*desc=*/[{
         Return the subset of output operands that are of buffer type.


        


More information about the Mlir-commits mailing list