MLIR  17.0.0git
BuiltinOps.h
Go to the documentation of this file.
1 //===- BuiltinOps.h - MLIR Builtin Operations -------------------*- C++ -*-===//
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 file contains the Builtin dialect's operations.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_IR_BUILTINOPS_H_
14 #define MLIR_IR_BUILTINOPS_H_
15 
17 #include "mlir/IR/OwningOpRef.h"
19 #include "mlir/IR/SymbolTable.h"
22 #include "llvm/Support/PointerLikeTypeTraits.h"
23 
24 //===----------------------------------------------------------------------===//
25 // Dialect Operations
26 //===----------------------------------------------------------------------===//
27 
28 #define GET_OP_CLASSES
29 #include "mlir/IR/BuiltinOps.h.inc"
30 
31 namespace llvm {
32 /// Allow stealing the low bits of ModuleOp.
33 template <>
34 struct PointerLikeTypeTraits<mlir::ModuleOp> {
35 public:
36  static inline void *getAsVoidPointer(mlir::ModuleOp val) {
37  return const_cast<void *>(val.getAsOpaquePointer());
38  }
39  static inline mlir::ModuleOp getFromVoidPointer(void *p) {
40  return mlir::ModuleOp::getFromOpaquePointer(p);
41  }
42  static constexpr int numLowBitsAvailable = 3;
43 };
44 } // namespace llvm
45 
46 #endif // MLIR_IR_BUILTINOPS_H_
Include the generated interface declarations.
Definition: CallGraph.h:229
This header declares functions that assit transformations in the MemRef dialect.
static mlir::ModuleOp getFromVoidPointer(void *p)
Definition: BuiltinOps.h:39
static void * getAsVoidPointer(mlir::ModuleOp val)
Definition: BuiltinOps.h:36