LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Polymorphic.h
Go to the documentation of this file.
1//===-- Polymorphic.h - C API for Polymorphic dialect -------------*- C -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9//
10// This header declares the C interface for registering and accessing the
11// Polymorphic dialect. A dialect should be registered with a context to make it
12// available to users of the context. These users must load the dialect
13// before using any of its attributes, operations, or types. Parser and pass
14// manager can load registered dialects automatically.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLZK_C_DIALECT_POLYMORPHIC_H
19#define LLZK_C_DIALECT_POLYMORPHIC_H
20
22
23#include "llzk-c/Support.h"
24
25#include <mlir-c/AffineExpr.h>
26#include <mlir-c/AffineMap.h>
27#include <mlir-c/IR.h>
28#include <mlir-c/Support.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Polymorphic, llzk__polymorphic);
35
36//===----------------------------------------------------------------------===//
37// TypeVarType
38//===----------------------------------------------------------------------===//
39
41MLIR_CAPI_EXPORTED MlirType llzkTypeVarTypeGet(MlirContext context, MlirStringRef value);
42
45
47MLIR_CAPI_EXPORTED MlirType llzkTypeVarTypeGetFromAttr(MlirContext context, MlirAttribute value);
48
50MLIR_CAPI_EXPORTED MlirStringRef llzkTypeVarTypeGetNameRef(MlirType type);
51
53MLIR_CAPI_EXPORTED MlirAttribute llzkTypeVarTypeGetName(MlirType type);
54
55//===----------------------------------------------------------------------===//
56// ApplyMapOp
57//===----------------------------------------------------------------------===//
58
60LLZK_DECLARE_OP_BUILD_METHOD(ApplyMapOp, MlirAttribute affineMapAttr, MlirValueRange operands);
61
64 ApplyMapOp, WithAffineMap, MlirAffineMap affineMap, MlirValueRange operands
65);
66
69 ApplyMapOp, WithAffineExpr, MlirAffineExpr affineExpr, MlirValueRange operands
70);
71
74
76MLIR_CAPI_EXPORTED MlirAffineMap llzkApplyMapOpGetAffineMap(MlirOperation op);
77
79MLIR_CAPI_EXPORTED intptr_t llzkApplyMapOpGetNumDimOperands(MlirOperation op);
80
84MLIR_CAPI_EXPORTED void llzkApplyMapOpGetDimOperands(MlirOperation op, MlirValue *dst);
85
87MLIR_CAPI_EXPORTED intptr_t llzkApplyMapOpGetNumSymbolOperands(MlirOperation op);
88
92MLIR_CAPI_EXPORTED void llzkApplyMapOpGetSymbolOperands(MlirOperation op, MlirValue *dst);
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
MLIR_CAPI_EXPORTED intptr_t llzkApplyMapOpGetNumSymbolOperands(MlirOperation op)
Returns the number of operands that correspond to symbols in the affine map.
MLIR_CAPI_EXPORTED void llzkApplyMapOpGetSymbolOperands(MlirOperation op, MlirValue *dst)
Writes into the destination buffer the operands that correspond to symbols in the affine map.
MLIR_CAPI_EXPORTED MlirAffineMap llzkApplyMapOpGetAffineMap(MlirOperation op)
Returns the affine map associated with the op.
MLIR_CAPI_EXPORTED void llzkApplyMapOpGetDimOperands(MlirOperation op, MlirValue *dst)
Writes into the destination buffer the operands that correspond to dimensions in the affine map.
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Polymorphic, llzk__polymorphic)
MLIR_CAPI_EXPORTED MlirAttribute llzkTypeVarTypeGetName(MlirType type)
Returns the var name of the TypeVarType as a FlatSymbolRefAttr.
MLIR_CAPI_EXPORTED intptr_t llzkApplyMapOpGetNumDimOperands(MlirOperation op)
Returns the number of operands that correspond to dimensions in the affine map.
MLIR_CAPI_EXPORTED MlirStringRef llzkTypeVarTypeGetNameRef(MlirType type)
Returns the var name of the TypeVarType as a StringRef.
MLIR_CAPI_EXPORTED MlirType llzkTypeVarTypeGetFromAttr(MlirContext context, MlirAttribute value)
Creates a llzk::polymorphic::TypeVarType from either a StringAttr or a FlatSymbolRefAttr.
MLIR_CAPI_EXPORTED MlirType llzkTypeVarTypeGet(MlirContext context, MlirStringRef value)
Creates a llzk::polymorphic::TypeVarType.
#define LLZK_DECLARE_OP_ISA(what)
Definition Support.h:48
#define LLZK_DECLARE_OP_BUILD_METHOD(op,...)
Definition Support.h:37
#define LLZK_DECLARE_TYPE_ISA(what)
Definition Support.h:47
#define LLZK_DECLARE_SUFFIX_OP_BUILD_METHOD(op, suffix,...)
Definition Support.h:32