brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · a0e3ea0 Raw
138 lines · c
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 LLVM4// Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef MLIR_C_DIALECT_EmitC_H11#define MLIR_C_DIALECT_EmitC_H12 13#include "mlir-c/IR.h"14#include "mlir-c/Support.h"15 16#ifdef __cplusplus17extern "C" {18#endif19 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// ArrayType34//===---------------------------------------------------------------------===//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// LValueType46//===---------------------------------------------------------------------===//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// OpaqueType56//===---------------------------------------------------------------------===//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// PointerType67//===---------------------------------------------------------------------===//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// PtrDiffTType77//===---------------------------------------------------------------------===//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// SignedSizeTType87//===---------------------------------------------------------------------===//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// SizeTType97//===---------------------------------------------------------------------===//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 MlirAttribute112mlirEmitCCmpPredicateAttrGet(MlirContext ctx, enum MlirEmitCCmpPredicate val);113 114MLIR_CAPI_EXPORTED enum MlirEmitCCmpPredicate115mlirEmitCCmpPredicateAttrGetValue(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 MlirStringRef129mlirEmitCOpaqueAttrGetValue(MlirAttribute attr);130 131MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCOpaqueAttrGetTypeID(void);132 133#ifdef __cplusplus134}135#endif136 137#endif // MLIR_C_DIALECT_EmitC_H138