xref: /llvm-project/mlir/include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.td (revision b1bc1a1ed6c906cbd31d6b7a9ffbd696306f86b0)
1//===- MaskingOpInterfaces.td - MaskingOpInterface Decls = -*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This is the definition file for the MaskingOpInterface.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_VECTOR_INTERFACES_MASKINGOPINTERFACE_TD
14#define MLIR_DIALECT_VECTOR_INTERFACES_MASKINGOPINTERFACE_TD
15
16include "mlir/IR/OpBase.td"
17
18def MaskingOpInterface : OpInterface<"MaskingOpInterface"> {
19  let description = [{
20    The 'MaskingOpInterface' defines an vector operation that can apply masking
21    to its own or other vector operations.
22  }];
23  let cppNamespace = "::mlir::vector";
24  let methods = [
25    InterfaceMethod<
26      /*desc=*/"Returns the mask value of this masking operation.",
27      /*retTy=*/"mlir::Value",
28      /*methodName=*/"getMask",
29      /*args=*/(ins),
30      /*methodBody=*/"",
31      /*defaultImplementation=*/"">,
32    InterfaceMethod<
33      /*desc=*/"Returns the operation masked by this masking operation.",
34      // TODO: Return a MaskableOpInterface when interface infra can handle
35      // dependences between interfaces.
36      /*retTy=*/"Operation *",
37      /*methodName=*/"getMaskableOp",
38      /*args=*/(ins),
39      /*methodBody=*/"",
40      /*defaultImplementation=*/"">,
41    InterfaceMethod<
42      /*desc=*/"Returns true if the masking operation has a passthru value.",
43      /*retTy=*/"bool",
44      /*methodName=*/"hasPassthru",
45      /*args=*/(ins),
46      /*methodBody=*/"",
47      /*defaultImplementation=*/"">,
48    InterfaceMethod<
49      /*desc=*/"Returns the passthru value of this masking operation.",
50      /*retTy=*/"mlir::Value",
51      /*methodName=*/"getPassthru",
52      /*args=*/(ins),
53      /*methodBody=*/"",
54      /*defaultImplementation=*/"">,
55  ];
56}
57
58#endif // MLIR_DIALECT_VECTOR_INTERFACES_MASKINGOPINTERFACE_TD
59