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

Differential Revision: https://reviews.llvm.org/D102301
This commit is contained in:
MaheshRavishankar 2021-05-12 16:06:02 -07:00
parent e7d26aceca
commit b7911e80d6
1 changed files with 16 additions and 0 deletions

View File

@ -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