MLIR 24.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
31namespace llvm {
32/// Allow stealing the low bits of ModuleOp.
33template <>
34struct PointerLikeTypeTraits<mlir::ModuleOp> {
35public:
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_
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition CallGraph.h:229
Include the generated interface declarations.
static mlir::ModuleOp getFromVoidPointer(void *p)
Definition BuiltinOps.h:39
static void * getAsVoidPointer(mlir::ModuleOp val)
Definition BuiltinOps.h:36