@@ -33,6 +33,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type);
3333MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet (MlirContext ctx ,
3434 unsigned bitwidth );
3535
36+ MLIR_CAPI_EXPORTED MlirStringRef mlirIntegerTypeGetName (void );
37+
3638/// Creates a signed integer type of the given bitwidth in the context. The type
3739/// is owned by the context.
3840MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet (MlirContext ctx ,
@@ -69,6 +71,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);
6971/// context.
7072MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet (MlirContext ctx );
7173
74+ MLIR_CAPI_EXPORTED MlirStringRef mlirIndexTypeGetName (void );
75+
7276//===----------------------------------------------------------------------===//
7377// Floating-point types.
7478//===----------------------------------------------------------------------===//
@@ -89,6 +93,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat4E2M1FN(MlirType type);
8993/// context.
9094MLIR_CAPI_EXPORTED MlirType mlirFloat4E2M1FNTypeGet (MlirContext ctx );
9195
96+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat4E2M1FNTypeGetName (void );
97+
9298/// Returns the typeID of an Float6E2M3FN type.
9399MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E2M3FNTypeGetTypeID (void );
94100
@@ -99,6 +105,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E2M3FN(MlirType type);
99105/// context.
100106MLIR_CAPI_EXPORTED MlirType mlirFloat6E2M3FNTypeGet (MlirContext ctx );
101107
108+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E2M3FNTypeGetName (void );
109+
102110/// Returns the typeID of an Float6E3M2FN type.
103111MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E3M2FNTypeGetTypeID (void );
104112
@@ -109,6 +117,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E3M2FN(MlirType type);
109117/// context.
110118MLIR_CAPI_EXPORTED MlirType mlirFloat6E3M2FNTypeGet (MlirContext ctx );
111119
120+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E3M2FNTypeGetName (void );
121+
112122/// Returns the typeID of an Float8E5M2 type.
113123MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2TypeGetTypeID (void );
114124
@@ -119,6 +129,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
119129/// context.
120130MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet (MlirContext ctx );
121131
132+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2TypeGetName (void );
133+
122134/// Returns the typeID of an Float8E4M3 type.
123135MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3TypeGetTypeID (void );
124136
@@ -129,6 +141,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3(MlirType type);
129141/// context.
130142MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet (MlirContext ctx );
131143
144+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3TypeGetName (void );
145+
132146/// Returns the typeID of an Float8E4M3FN type.
133147MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNTypeGetTypeID (void );
134148
@@ -139,6 +153,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FN(MlirType type);
139153/// context.
140154MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet (MlirContext ctx );
141155
156+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNTypeGetName (void );
157+
142158/// Returns the typeID of an Float8E5M2FNUZ type.
143159MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2FNUZTypeGetTypeID (void );
144160
@@ -149,6 +165,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2FNUZ(MlirType type);
149165/// context.
150166MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet (MlirContext ctx );
151167
168+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2FNUZTypeGetName (void );
169+
152170/// Returns the typeID of an Float8E4M3FNUZ type.
153171MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID (void );
154172
@@ -159,6 +177,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FNUZ(MlirType type);
159177/// context.
160178MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet (MlirContext ctx );
161179
180+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNUZTypeGetName (void );
181+
162182/// Returns the typeID of an Float8E4M3B11FNUZ type.
163183MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3B11FNUZTypeGetTypeID (void );
164184
@@ -169,6 +189,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3B11FNUZ(MlirType type);
169189/// context.
170190MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet (MlirContext ctx );
171191
192+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3B11FNUZTypeGetName (void );
193+
172194/// Returns the typeID of an Float8E3M4 type.
173195MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E3M4TypeGetTypeID (void );
174196
@@ -179,6 +201,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E3M4(MlirType type);
179201/// context.
180202MLIR_CAPI_EXPORTED MlirType mlirFloat8E3M4TypeGet (MlirContext ctx );
181203
204+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E3M4TypeGetName (void );
205+
182206/// Returns the typeID of an Float8E8M0FNU type.
183207MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E8M0FNUTypeGetTypeID (void );
184208
@@ -189,6 +213,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E8M0FNU(MlirType type);
189213/// context.
190214MLIR_CAPI_EXPORTED MlirType mlirFloat8E8M0FNUTypeGet (MlirContext ctx );
191215
216+ MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E8M0FNUTypeGetName (void );
217+
192218/// Returns the typeID of an BFloat16 type.
193219MLIR_CAPI_EXPORTED MlirTypeID mlirBFloat16TypeGetTypeID (void );
194220
@@ -199,6 +225,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
199225/// context.
200226MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet (MlirContext ctx );
201227
228+ MLIR_CAPI_EXPORTED MlirStringRef mlirBF16TypeGetName (void );
229+
202230/// Returns the typeID of an Float16 type.
203231MLIR_CAPI_EXPORTED MlirTypeID mlirFloat16TypeGetTypeID (void );
204232
@@ -209,6 +237,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
209237/// context.
210238MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet (MlirContext ctx );
211239
240+ MLIR_CAPI_EXPORTED MlirStringRef mlirF16TypeGetName (void );
241+
212242/// Returns the typeID of an Float32 type.
213243MLIR_CAPI_EXPORTED MlirTypeID mlirFloat32TypeGetTypeID (void );
214244
@@ -219,6 +249,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
219249/// context.
220250MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet (MlirContext ctx );
221251
252+ MLIR_CAPI_EXPORTED MlirStringRef mlirF32TypeGetName (void );
253+
222254/// Returns the typeID of an Float64 type.
223255MLIR_CAPI_EXPORTED MlirTypeID mlirFloat64TypeGetTypeID (void );
224256
@@ -229,6 +261,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
229261/// context.
230262MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet (MlirContext ctx );
231263
264+ MLIR_CAPI_EXPORTED MlirStringRef mlirF64TypeGetName (void );
265+
232266/// Returns the typeID of a TF32 type.
233267MLIR_CAPI_EXPORTED MlirTypeID mlirFloatTF32TypeGetTypeID (void );
234268
@@ -239,6 +273,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
239273/// context.
240274MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet (MlirContext ctx );
241275
276+ MLIR_CAPI_EXPORTED MlirStringRef mlirTF32TypeGetName (void );
277+
242278//===----------------------------------------------------------------------===//
243279// None type.
244280//===----------------------------------------------------------------------===//
@@ -253,6 +289,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
253289/// context.
254290MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet (MlirContext ctx );
255291
292+ MLIR_CAPI_EXPORTED MlirStringRef mlirNoneTypeGetName (void );
293+
256294//===----------------------------------------------------------------------===//
257295// Complex type.
258296//===----------------------------------------------------------------------===//
@@ -267,6 +305,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
267305/// the element type. The type is owned by the context.
268306MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet (MlirType elementType );
269307
308+ MLIR_CAPI_EXPORTED MlirStringRef mlirComplexTypeGetName (void );
309+
270310/// Returns the element type of the given complex type.
271311MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGetElementType (MlirType type );
272312
@@ -341,6 +381,8 @@ MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank,
341381 const int64_t * shape ,
342382 MlirType elementType );
343383
384+ MLIR_CAPI_EXPORTED MlirStringRef mlirVectorTypeGetName (void );
385+
344386/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
345387/// illegal arguments, emitting appropriate diagnostics.
346388MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked (MlirLocation loc ,
@@ -402,6 +444,8 @@ MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank,
402444 MlirType elementType ,
403445 MlirAttribute encoding );
404446
447+ MLIR_CAPI_EXPORTED MlirStringRef mlirRankedTensorTypeGetName (void );
448+
405449/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
406450/// illegal arguments, emitting appropriate diagnostics.
407451MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGetChecked (
@@ -416,6 +460,8 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
416460/// context as the element type. The type is owned by the context.
417461MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet (MlirType elementType );
418462
463+ MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedTensorTypeGetName (void );
464+
419465/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
420466/// on illegal arguments, emitting appropriate diagnostics.
421467MLIR_CAPI_EXPORTED MlirType
@@ -446,6 +492,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
446492 MlirAttribute layout ,
447493 MlirAttribute memorySpace );
448494
495+ MLIR_CAPI_EXPORTED MlirStringRef mlirMemRefTypeGetName (void );
496+
449497/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
450498/// illegal arguments, emitting appropriate diagnostics.
451499MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGetChecked (
@@ -471,6 +519,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGetChecked(
471519MLIR_CAPI_EXPORTED MlirType
472520mlirUnrankedMemRefTypeGet (MlirType elementType , MlirAttribute memorySpace );
473521
522+ MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedMemRefTypeGetName (void );
523+
474524/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
475525/// MlirType on illegal arguments, emitting appropriate diagnostics.
476526MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGetChecked (
@@ -511,6 +561,8 @@ MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
511561 intptr_t numElements ,
512562 MlirType const * elements );
513563
564+ MLIR_CAPI_EXPORTED MlirStringRef mlirTupleTypeGetName (void );
565+
514566/// Returns the number of types contained in a tuple.
515567MLIR_CAPI_EXPORTED intptr_t mlirTupleTypeGetNumTypes (MlirType type );
516568
@@ -534,6 +586,8 @@ MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
534586 intptr_t numResults ,
535587 MlirType const * results );
536588
589+ MLIR_CAPI_EXPORTED MlirStringRef mlirFunctionTypeGetName (void );
590+
537591/// Returns the number of input types.
538592MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs (MlirType type );
539593
@@ -565,6 +619,8 @@ MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
565619 MlirStringRef dialectNamespace ,
566620 MlirStringRef typeData );
567621
622+ MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetName (void );
623+
568624/// Returns the namespace of the dialect with which the given opaque type
569625/// is associated. The namespace string is owned by the context.
570626MLIR_CAPI_EXPORTED MlirStringRef
0 commit comments