1 //===- Async.h - MLIR Async dialect -----------------------------*- 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 defines the async dialect that is used for modeling asynchronous
10 // execution.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_DIALECT_ASYNC_IR_ASYNC_H
15 #define MLIR_DIALECT_ASYNC_IR_ASYNC_H
16 
17 #include "mlir/Dialect/Async/IR/AsyncTypes.h"
18 #include "mlir/IR/Builders.h"
19 #include "mlir/IR/BuiltinTypes.h"
20 #include "mlir/IR/Dialect.h"
21 #include "mlir/IR/OpDefinition.h"
22 #include "mlir/IR/OpImplementation.h"
23 #include "mlir/Interfaces/ControlFlowInterfaces.h"
24 #include "mlir/Interfaces/SideEffectInterfaces.h"
25 
26 //===----------------------------------------------------------------------===//
27 // Async Dialect
28 //===----------------------------------------------------------------------===//
29 
30 #include "mlir/Dialect/Async/IR/AsyncOpsDialect.h.inc"
31 
32 //===----------------------------------------------------------------------===//
33 // Async Dialect Operations
34 //===----------------------------------------------------------------------===//
35 
36 #define GET_OP_CLASSES
37 #include "mlir/Dialect/Async/IR/AsyncOps.h.inc"
38 
39 //===----------------------------------------------------------------------===//
40 // Helper functions of Async dialect transformations.
41 //===----------------------------------------------------------------------===//
42 
43 namespace mlir {
44 namespace async {
45 
46 /// Returns true if the type is reference counted at runtime.
isRefCounted(Type type)47 inline bool isRefCounted(Type type) {
48   return type.isa<TokenType, ValueType, GroupType>();
49 }
50 
51 } // namespace async
52 } // namespace mlir
53 
54 #endif // MLIR_DIALECT_ASYNC_IR_ASYNC_H
55