[Mlir-commits] [mlir] b7911e8 - [mlir][Linalg] Add interface methods to get lhs and rhs of contraction

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed May 12 16:07:24 PDT 2021


Author: MaheshRavishankar
Date: 2021-05-12T16:07:10-07:00
New Revision: b7911e80d6926f9280ceb23d4e86e25c29370904

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

LOG: [mlir][Linalg] Add interface methods to get lhs and rhs of contraction

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

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 80bd3775cfe24..b7f56edff4fd7 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -35,6 +35,22 @@ def LinalgContractionOpInterface : OpInterface<"ContractionOpInterface"> {
   let cppNamespace = "::mlir::linalg";
   let verify = [{ return detail::verifyContractionInterface($_op); }];
   let methods = [
+    InterfaceMethod<
+    /*desc=*/"Returns the left-hand side operand.",
+    /*retTy=*/"Value",
+    /*methodName=*/"lhs",
+    /*args=*/(ins),
+    /*methodBody=*/[{
+      return $_op.getOperation()->getOperand(0);
+    }]>,
+    InterfaceMethod<
+    /*desc=*/"Returns the right-hand side operand.",
+    /*retTy=*/"Value",
+    /*methodName=*/"rhs",
+    /*args=*/(ins),
+    /*methodBody=*/[{
+      return $_op.getOperation()->getOperand(1);
+    }]>,
     InterfaceMethod<
     /*desc=*/[{
       Returns whether the given op has indexing maps that correspond to a


        


More information about the Mlir-commits mailing list