xref: /aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/mlir_hlo/include/mlir-hlo/Dialect/lhlo/IR/lhlo_ops.h (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1 /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 // This file defines the operations used in the LHLO dialect.
17 
18 #ifndef MLIR_HLO_DIALECT_LHLO_IR_LHLO_OPS_H
19 #define MLIR_HLO_DIALECT_LHLO_IR_LHLO_OPS_H
20 
21 #include "llvm/ADT/StringRef.h"
22 #include "mlir-hlo/Dialect/lhlo/IR/lhlo_ops_structs.h"
23 #include "mlir-hlo/Dialect/lhlo/IR/lhlo_structured_interface.h"
24 #include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.h"
25 #include "mlir/Dialect/Bufferization/IR/Bufferization.h"
26 #include "mlir/Dialect/Func/IR/FuncOps.h"
27 #include "mlir/Dialect/MemRef/IR/MemRef.h"
28 #include "mlir/IR/Attributes.h"
29 #include "mlir/IR/BuiltinTypes.h"
30 #include "mlir/IR/Dialect.h"
31 #include "mlir/IR/Location.h"
32 #include "mlir/IR/MLIRContext.h"
33 #include "mlir/IR/OpDefinition.h"
34 #include "mlir/IR/Operation.h"
35 #include "mlir/IR/Types.h"
36 #include "mlir/Interfaces/ControlFlowInterfaces.h"
37 #include "mlir/Interfaces/CopyOpInterface.h"
38 #include "mlir/Interfaces/LoopLikeInterface.h"
39 #include "mlir/Interfaces/SideEffectInterfaces.h"
40 #include "mlir/Interfaces/ViewLikeInterface.h"
41 
42 namespace mlir {
43 class OpBuilder;
44 namespace lmhlo {
45 
46 class LmhloDialect : public Dialect {
47  public:
48   explicit LmhloDialect(MLIRContext *context);
getDialectNamespace()49   static StringRef getDialectNamespace() { return "lmhlo"; }
50 
51   // Parses an attribute registered to this dialect.
52   Attribute parseAttribute(DialectAsmParser &parser, Type type) const override;
53 
54   // Prints an attribute registered to this dialect.
55   void printAttribute(Attribute attr, DialectAsmPrinter &os) const override;
56 };
57 
58 }  // namespace lmhlo
59 }  // end namespace mlir
60 
61 #define GET_OP_CLASSES
62 #include "mlir-hlo/Dialect/lhlo/IR/lhlo_ops.h.inc"
63 
64 #endif  // MLIR_HLO_DIALECT_LHLO_IR_LHLO_OPS_H
65