1*7fc792cbSSang Ik Lee //===- SPIRVToLLVMIRTranslation.cpp - Translate SPIR-V to LLVM IR ---------===// 2*7fc792cbSSang Ik Lee // 3*7fc792cbSSang Ik Lee // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*7fc792cbSSang Ik Lee // See https://llvm.org/LICENSE.txt for license information. 5*7fc792cbSSang Ik Lee // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*7fc792cbSSang Ik Lee // 7*7fc792cbSSang Ik Lee //===----------------------------------------------------------------------===// 8*7fc792cbSSang Ik Lee // 9*7fc792cbSSang Ik Lee // This file implements a translation between the MLIR SPIR-V dialect and 10*7fc792cbSSang Ik Lee // LLVM IR. 11*7fc792cbSSang Ik Lee // 12*7fc792cbSSang Ik Lee //===----------------------------------------------------------------------===// 13*7fc792cbSSang Ik Lee 14*7fc792cbSSang Ik Lee #include "mlir/Target/LLVMIR/Dialect/SPIRV/SPIRVToLLVMIRTranslation.h" 15*7fc792cbSSang Ik Lee #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" 16*7fc792cbSSang Ik Lee #include "mlir/IR/BuiltinAttributes.h" 17*7fc792cbSSang Ik Lee #include "mlir/IR/Operation.h" 18*7fc792cbSSang Ik Lee #include "mlir/Target/LLVMIR/ModuleTranslation.h" 19*7fc792cbSSang Ik Lee 20*7fc792cbSSang Ik Lee using namespace mlir; 21*7fc792cbSSang Ik Lee using namespace mlir::LLVM; 22*7fc792cbSSang Ik Lee registerSPIRVDialectTranslation(DialectRegistry & registry)23*7fc792cbSSang Ik Leevoid mlir::registerSPIRVDialectTranslation(DialectRegistry ®istry) { 24*7fc792cbSSang Ik Lee registry.insert<spirv::SPIRVDialect>(); 25*7fc792cbSSang Ik Lee } 26*7fc792cbSSang Ik Lee registerSPIRVDialectTranslation(MLIRContext & context)27*7fc792cbSSang Ik Leevoid mlir::registerSPIRVDialectTranslation(MLIRContext &context) { 28*7fc792cbSSang Ik Lee DialectRegistry registry; 29*7fc792cbSSang Ik Lee registerSPIRVDialectTranslation(registry); 30*7fc792cbSSang Ik Lee context.appendDialectRegistry(registry); 31*7fc792cbSSang Ik Lee } 32