CIRCT 21.0.0git
Loading...
Searching...
No Matches
RTG.h
Go to the documentation of this file.
1//===- RTG.h - C interface for the for RTG 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#ifndef CIRCT_C_DIALECT_RTG_H
10#define CIRCT_C_DIALECT_RTG_H
11
12#include "mlir-c/IR.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18//===----------------------------------------------------------------------===//
19// Dialect API.
20//===----------------------------------------------------------------------===//
21
23
24//===----------------------------------------------------------------------===//
25// Type API.
26//===----------------------------------------------------------------------===//
27
28/// If the type is an RTG sequence.
29MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type);
30
31/// Creates an RTG sequence type in the context.
32MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt,
33 intptr_t numElements,
34 MlirType const *elementTypes);
35
36/// The number of substitution elements of the RTG sequence.
37MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type);
38
39/// The type of of the substitution element at the given index.
40MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type,
41 unsigned i);
42
43/// If the type is an RTG randomized sequence.
44MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type);
45
46/// Creates an RTG randomized sequence type in the context.
47MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt);
48
49/// If the type is an RTG label.
50MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type);
51
52/// Creates an RTG mode type in the context.
53MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt);
54
55/// If the type is an RTG set.
56MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type);
57
58/// Creates an RTG set type in the context.
59MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType);
60
61/// Return the element type of the RTG set.
62MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type);
63
64/// If the type is an RTG bag.
65MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type);
66
67/// Creates an RTG bag type in the context.
68MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType);
69
70/// Return the element type of the RTG bag.
71MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type);
72
73/// If the type is an RTG dict.
74MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type);
75
76/// Creates an RTG dict type in the context.
77MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt,
78 intptr_t numEntries,
79 MlirAttribute const *entryNames,
80 MlirType const *entryTypes);
81
82//===----------------------------------------------------------------------===//
83// Attribute API.
84//===----------------------------------------------------------------------===//
85
92
93/// If the attribute is an RTG label visibility.
94MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr);
95
96/// Get the RTG label visibility from the attribute.
97MLIR_CAPI_EXPORTED RTGLabelVisibility
98rtgLabelVisibilityAttrGetValue(MlirAttribute attr);
99
100/// Creates an RTG label visibility attribute in the context.
101MLIR_CAPI_EXPORTED MlirAttribute
102rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility);
103
104/// If the attribute is an RTG default context.
105MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr);
106
107/// Creates an RTG default context attribute in the context.
108MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt,
109 MlirType type);
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif // CIRCT_C_DIALECT_RTG_H
MlirType uint64_t numElements
Definition CHIRRTL.cpp:30
MlirType elementType
Definition CHIRRTL.cpp:29
MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt)
Creates an RTG mode type in the context.
Definition RTG.cpp:68
MLIR_CAPI_EXPORTED RTGLabelVisibility rtgLabelVisibilityAttrGetValue(MlirAttribute attr)
Get the RTG label visibility from the attribute.
Definition RTG.cpp:126
RTGLabelVisibility
Definition RTG.h:86
@ RTG_LABEL_VISIBILITY_EXTERNAL
Definition RTG.h:89
@ RTG_LABEL_VISIBILITY_GLOBAL
Definition RTG.h:88
@ RTG_LABEL_VISIBILITY_LOCAL
Definition RTG.h:87
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type, unsigned i)
The type of of the substitution element at the given index.
Definition RTG.cpp:48
MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt, MlirType type)
Creates an RTG default context attribute in the context.
Definition RTG.cpp:159
MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr)
If the attribute is an RTG label visibility.
Definition RTG.cpp:122
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(RTG, rtg)
MLIR_CAPI_EXPORTED MlirAttribute rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility)
Creates an RTG label visibility attribute in the context.
Definition RTG.cpp:140
MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type)
If the type is an RTG bag.
Definition RTG.cpp:89
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt, intptr_t numElements, MlirType const *elementTypes)
Creates an RTG sequence type in the context.
Definition RTG.cpp:36
MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type)
The number of substitution elements of the RTG sequence.
Definition RTG.cpp:44
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType)
Creates an RTG set type in the context.
Definition RTG.cpp:77
MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type)
If the type is an RTG set.
Definition RTG.cpp:75
MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt)
Creates an RTG randomized sequence type in the context.
Definition RTG.cpp:59
MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type)
If the type is an RTG randomized sequence.
Definition RTG.cpp:55
MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type)
If the type is an RTG dict.
Definition RTG.cpp:103
MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt, intptr_t numEntries, MlirAttribute const *entryNames, MlirType const *entryTypes)
Creates an RTG dict type in the context.
Definition RTG.cpp:105
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType)
Creates an RTG bag type in the context.
Definition RTG.cpp:91
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type)
Return the element type of the RTG bag.
Definition RTG.cpp:96
MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type)
If the type is an RTG sequence.
Definition RTG.cpp:32
MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type)
If the type is an RTG label.
Definition RTG.cpp:66
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type)
Return the element type of the RTG set.
Definition RTG.cpp:82
MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr)
If the attribute is an RTG default context.
Definition RTG.cpp:155
Definition rtg.py:1