[Mlir-commits] [mlir] dbf1fe5 - [mlir][Linalg] Slightly adjust DestinationStyleOpInterface.

Adrian Kuegel llvmlistbot at llvm.org
Thu Sep 29 04:02:07 PDT 2022


Author: Adrian Kuegel
Date: 2022-09-29T13:01:50+02:00
New Revision: dbf1fe5024e205f295ed0280d602d582774c39c9

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

LOG: [mlir][Linalg] Slightly adjust DestinationStyleOpInterface.

Rename some interface methods to be consistent with the new accessor names.
This is a preparation for adding a ReduceOp, which then will implement
getIteratorTypes() and getOutputs() instead of iterator_types() and outputs().

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

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 38031704dbf5f..299f931b77198 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -488,7 +488,7 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
       /*args=*/(ins),
       /*methodBody=*/"",
       /*defaultImplementation=*/[{
-        return $_op.iterator_types();
+        return $_op.getIteratorTypes();
       }]
     >,
     InterfaceMethod<
@@ -781,7 +781,8 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
     }
 
     ValueRange outputs() {
-      return cast<DestinationStyleOpInterface>(*this->getOperation()).outputs();
+      return cast<DestinationStyleOpInterface>(*this->getOperation())
+          .getOutputs();
     }
 
     int64_t getNumOutputs() {
@@ -921,7 +922,8 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
 // The 'DestinationStyleOpInterface' provides access to the methods relevant
 // for destination-style ops. A destination-style operation has 'n' input
 // arguments and 'm' output arguments. Each op that wants to implement
-// DestinationStyleOpInterface needs to define inputs() and outputs() methods.
+// DestinationStyleOpInterface needs to define inputs() and getOutputs()
+// methods.
 def DestinationStyleOpInterface : OpInterface<"DestinationStyleOpInterface"> {
   let cppNamespace = "::mlir::linalg";
   let methods = [
@@ -952,14 +954,14 @@ def DestinationStyleOpInterface : OpInterface<"DestinationStyleOpInterface"> {
         return $_op.getInputs().size();
       }]
     >,
-    // `outputs` must be defined by each op that wants to implement the
+    // `getOutputs` must be defined by each op that wants to implement the
     // DestinationStyleOpInterface.
     InterfaceMethod<
       /*desc=*/[{
         Return the output shape operands.
       }],
       /*retTy=*/"ValueRange",
-      /*methodName=*/"outputs",
+      /*methodName=*/"getOutputs",
       /*args=*/(ins)
     >,
     InterfaceMethod<
@@ -971,7 +973,7 @@ def DestinationStyleOpInterface : OpInterface<"DestinationStyleOpInterface"> {
       /*args=*/(ins),
       /*methodBody=*/"",
       /*defaultImplementation=*/[{
-        return $_op.outputs().size();
+        return $_op.getOutputs().size();
       }]
     >,
     InterfaceMethod<


        


More information about the Mlir-commits mailing list