CIRCT 20.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/// If the type is an RTG bag.
62MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type);
63
64/// Creates an RTG bag type in the context.
65MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType);
66
67/// If the type is an RTG dict.
68MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type);
69
70/// Creates an RTG dict type in the context.
71MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt,
72 intptr_t numEntries,
73 MlirAttribute const *entryNames,
74 MlirType const *entryTypes);
75
76//===----------------------------------------------------------------------===//
77// Attribute API.
78//===----------------------------------------------------------------------===//
79
86
87/// If the attribute is an RTG label visibility.
88MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr);
89
90/// Get the RTG label visibility from the attribute.
91MLIR_CAPI_EXPORTED RTGLabelVisibility
92rtgLabelVisibilityAttrGetValue(MlirAttribute attr);
93
94/// Creates an RTG label visibility attribute in the context.
95MLIR_CAPI_EXPORTED MlirAttribute
96rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility);
97
98#ifdef __cplusplus
99}
100#endif
101
102#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:67
MLIR_CAPI_EXPORTED RTGLabelVisibility rtgLabelVisibilityAttrGetValue(MlirAttribute attr)
Get the RTG label visibility from the attribute.
Definition RTG.cpp:117
RTGLabelVisibility
Definition RTG.h:80
@ RTG_LABEL_VISIBILITY_EXTERNAL
Definition RTG.h:83
@ RTG_LABEL_VISIBILITY_GLOBAL
Definition RTG.h:82
@ RTG_LABEL_VISIBILITY_LOCAL
Definition RTG.h:81
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type, unsigned i)
The type of of the substitution element at the given index.
Definition RTG.cpp:47
MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr)
If the attribute is an RTG label visibility.
Definition RTG.cpp:113
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:131
MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type)
If the type is an RTG bag.
Definition RTG.cpp:84
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt, intptr_t numElements, MlirType const *elementTypes)
Creates an RTG sequence type in the context.
Definition RTG.cpp:35
MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type)
The number of substitution elements of the RTG sequence.
Definition RTG.cpp:43
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType)
Creates an RTG set type in the context.
Definition RTG.cpp:76
MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type)
If the type is an RTG set.
Definition RTG.cpp:74
MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt)
Creates an RTG randomized sequence type in the context.
Definition RTG.cpp:58
MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type)
If the type is an RTG randomized sequence.
Definition RTG.cpp:54
MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type)
If the type is an RTG dict.
Definition RTG.cpp:94
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:96
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType)
Creates an RTG bag type in the context.
Definition RTG.cpp:86
MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type)
If the type is an RTG sequence.
Definition RTG.cpp:31
MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type)
If the type is an RTG label.
Definition RTG.cpp:65
Definition rtg.py:1