1//===-- mlir-c/Dialect/EmitC.h - C API for EmitC dialect ----------*- C -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM
4// Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef MLIR_C_DIALECT_EmitC_H
11#define MLIR_C_DIALECT_EmitC_H
12
13#include "mlir-c/IR.h"
14#include "mlir-c/Support.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(EmitC, emitc);
21
22enum MlirEmitCCmpPredicate : uint64_t {
23 MLIR_EMITC_CMP_PREDICATE_EQ = 0,
24 MLIR_EMITC_CMP_PREDICATE_NE = 1,
25 MLIR_EMITC_CMP_PREDICATE_LT = 2,
26 MLIR_EMITC_CMP_PREDICATE_LE = 3,
27 MLIR_EMITC_CMP_PREDICATE_GT = 4,
28 MLIR_EMITC_CMP_PREDICATE_GE = 5,
29 MLIR_EMITC_CMP_PREDICATE_THREE_WAY = 6,
30};
31
32//===---------------------------------------------------------------------===//
33// ArrayType
34//===---------------------------------------------------------------------===//
35
36MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCArrayType(MlirType type);
37
38MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCArrayTypeGetTypeID(void);
39
40MLIR_CAPI_EXPORTED MlirType mlirEmitCArrayTypeGet(intptr_t nDims,
41 int64_t *shape,
42 MlirType elementType);
43
44//===---------------------------------------------------------------------===//
45// LValueType
46//===---------------------------------------------------------------------===//
47
48MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCLValueType(MlirType type);
49
50MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCLValueTypeGetTypeID(void);
51
52MLIR_CAPI_EXPORTED MlirType mlirEmitCLValueTypeGet(MlirType valueType);
53
54//===---------------------------------------------------------------------===//
55// OpaqueType
56//===---------------------------------------------------------------------===//
57
58MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCOpaqueType(MlirType type);
59
60MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCOpaqueTypeGetTypeID(void);
61
62MLIR_CAPI_EXPORTED MlirType mlirEmitCOpaqueTypeGet(MlirContext ctx,
63 MlirStringRef value);
64
65//===---------------------------------------------------------------------===//
66// PointerType
67//===---------------------------------------------------------------------===//
68
69MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCPointerType(MlirType type);
70
71MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPointerTypeGetTypeID(void);
72
73MLIR_CAPI_EXPORTED MlirType mlirEmitCPointerTypeGet(MlirType pointee);
74
75//===---------------------------------------------------------------------===//
76// PtrDiffTType
77//===---------------------------------------------------------------------===//
78
79MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCPtrDiffTType(MlirType type);
80
81MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPtrDiffTTypeGetTypeID(void);
82
83MLIR_CAPI_EXPORTED MlirType mlirEmitCPtrDiffTTypeGet(MlirContext ctx);
84
85//===---------------------------------------------------------------------===//
86// SignedSizeTType
87//===---------------------------------------------------------------------===//
88
89MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCSignedSizeTType(MlirType type);
90
91MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSignedSizeTTypeGetTypeID(void);
92
93MLIR_CAPI_EXPORTED MlirType mlirEmitCSignedSizeTTypeGet(MlirContext ctx);
94
95//===---------------------------------------------------------------------===//
96// SizeTType
97//===---------------------------------------------------------------------===//
98
99MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCSizeTType(MlirType type);
100
101MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSizeTTypeGetTypeID(void);
102
103MLIR_CAPI_EXPORTED MlirType mlirEmitCSizeTTypeGet(MlirContext ctx);
104
105//===----------------------------------------------------------------------===//
106// CmpPredicate attribute.
107//===----------------------------------------------------------------------===//
108
109MLIR_CAPI_EXPORTED bool mlirAttributeIsAEmitCCmpPredicate(MlirAttribute attr);
110
111MLIR_CAPI_EXPORTED MlirAttribute
112mlirEmitCCmpPredicateAttrGet(MlirContext ctx, enum MlirEmitCCmpPredicate val);
113
114MLIR_CAPI_EXPORTED enum MlirEmitCCmpPredicate
115mlirEmitCCmpPredicateAttrGetValue(MlirAttribute attr);
116
117MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCCmpPredicateAttrGetTypeID(void);
118
119//===----------------------------------------------------------------------===//
120// Opaque attribute.
121//===----------------------------------------------------------------------===//
122
123MLIR_CAPI_EXPORTED bool mlirAttributeIsAEmitCOpaque(MlirAttribute attr);
124
125MLIR_CAPI_EXPORTED MlirAttribute mlirEmitCOpaqueAttrGet(MlirContext ctx,
126 MlirStringRef value);
127
128MLIR_CAPI_EXPORTED MlirStringRef
129mlirEmitCOpaqueAttrGetValue(MlirAttribute attr);
130
131MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCOpaqueAttrGetTypeID(void);
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif // MLIR_C_DIALECT_EmitC_H
138

source code of mlir/include/mlir-c/Dialect/EmitC.h