Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

86 lines
2.9 KiB
C

//===-- LLVMIR.h - C Interface for MLIR LLVMIR Target -------------*- C -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM
// Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This header declares the C interface to target LLVMIR with MLIR.
//
//===----------------------------------------------------------------------===//
#ifndef MLIR_C_TARGET_LLVMIR_H
#define MLIR_C_TARGET_LLVMIR_H
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"
#include "llvm-c/Core.h"
#include "llvm-c/Support.h"
#ifdef __cplusplus
extern "C" {
#endif
/// Translate operation that satisfies LLVM dialect module requirements into an
/// LLVM IR module living in the given context. This translates operations from
/// any dilalect that has a registered implementation of
/// LLVMTranslationDialectInterface.
///
/// \returns the generated LLVM IR Module from the translated MLIR module, it is
/// owned by the caller.
MLIR_CAPI_EXPORTED LLVMModuleRef
mlirTranslateModuleToLLVMIR(MlirOperation module, LLVMContextRef context);
MLIR_CAPI_EXPORTED char *
mlirTranslateModuleToLLVMIRToString(MlirOperation module);
struct MlirTypeFromLLVMIRTranslator {
void *ptr;
};
typedef struct MlirTypeFromLLVMIRTranslator MlirTypeFromLLVMIRTranslator;
/// Create an LLVM::TypeFromLLVMIRTranslator and transfer ownership to the
/// caller.
MLIR_CAPI_EXPORTED MlirTypeFromLLVMIRTranslator
mlirTypeFromLLVMIRTranslatorCreate(MlirContext ctx);
/// Takes an LLVM::TypeFromLLVMIRTranslator owned by the caller and destroys it.
/// It is the responsibility of the user to only pass an
/// LLVM::TypeFromLLVMIRTranslator class.
MLIR_CAPI_EXPORTED void
mlirTypeFromLLVMIRTranslatorDestroy(MlirTypeFromLLVMIRTranslator translator);
/// Translates the given LLVM IR type to the MLIR LLVM dialect.
MLIR_CAPI_EXPORTED MlirType mlirTypeFromLLVMIRTranslatorTranslateType(
MlirTypeFromLLVMIRTranslator translator, LLVMTypeRef llvmType);
struct MlirTypeToLLVMIRTranslator {
void *ptr;
};
typedef struct MlirTypeToLLVMIRTranslator MlirTypeToLLVMIRTranslator;
/// Create an LLVM::TypeToLLVMIRTranslator and transfer ownership to the
/// caller.
MLIR_CAPI_EXPORTED MlirTypeToLLVMIRTranslator
mlirTypeToLLVMIRTranslatorCreate(LLVMContextRef ctx);
/// Takes an LLVM::TypeToLLVMIRTranslator owned by the caller and destroys it.
/// It is the responsibility of the user to only pass an
/// LLVM::TypeToLLVMIRTranslator class.
MLIR_CAPI_EXPORTED void
mlirTypeToLLVMIRTranslatorDestroy(MlirTypeToLLVMIRTranslator translator);
/// Translates the given MLIR LLVM dialect to the LLVM IR type.
MLIR_CAPI_EXPORTED LLVMTypeRef mlirTypeToLLVMIRTranslatorTranslateType(
MlirTypeToLLVMIRTranslator translator, MlirType mlirType);
#ifdef __cplusplus
}
#endif
#endif // MLIR_C_TARGET_LLVMIR_H