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
16#include "mlir/IR/OwningOpRef.h"
18#include "llvm/Support/PointerLikeTypeTraits.h"
19
20//===----------------------------------------------------------------------===//
21// Dialect Operations
22//===----------------------------------------------------------------------===//
23
24#define GET_OP_CLASSES
25#include "mlir/IR/BuiltinOps.h.inc"
26
27namespace llvm {
28/// Allow stealing the low bits of ModuleOp.
29template <>
30struct PointerLikeTypeTraits<mlir::ModuleOp> {
31public:
32 static inline void *getAsVoidPointer(mlir::ModuleOp val) {
33 return const_cast<void *>(val.getAsOpaquePointer());
34 }
35 static inline mlir::ModuleOp getFromVoidPointer(void *p) {
36 return mlir::ModuleOp::getFromOpaquePointer(p);
37 }
38 static constexpr int NumLowBitsAvailable = 3;
39};
40} // namespace llvm
41
42#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:35
static void * getAsVoidPointer(mlir::ModuleOp val)
Definition BuiltinOps.h:32