MLIR
20.0.0git
lib
Target
LLVMIR
Dialect
SPIRV
SPIRVToLLVMIRTranslation.cpp
Go to the documentation of this file.
1
//===- SPIRVToLLVMIRTranslation.cpp - Translate SPIR-V to LLVM IR ---------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file implements a translation between the MLIR SPIR-V dialect and
10
// LLVM IR.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#include "
mlir/Target/LLVMIR/Dialect/SPIRV/SPIRVToLLVMIRTranslation.h
"
15
#include "
mlir/Dialect/SPIRV/IR/SPIRVDialect.h
"
16
#include "
mlir/IR/BuiltinAttributes.h
"
17
#include "
mlir/IR/Operation.h
"
18
#include "
mlir/Target/LLVMIR/ModuleTranslation.h
"
19
20
using namespace
mlir
;
21
using namespace
mlir::LLVM
;
22
23
void
mlir::registerSPIRVDialectTranslation
(
DialectRegistry
®istry) {
24
registry.
insert
<spirv::SPIRVDialect>();
25
}
26
27
void
mlir::registerSPIRVDialectTranslation
(
MLIRContext
&context) {
28
DialectRegistry
registry;
29
registerSPIRVDialectTranslation
(registry);
30
context.
appendDialectRegistry
(registry);
31
}
Operation.h
ModuleTranslation.h
SPIRVDialect.h
SPIRVToLLVMIRTranslation.h
mlir::DialectRegistry
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Definition:
DialectRegistry.h:139
mlir::DialectRegistry::insert
void insert()
Definition:
DialectRegistry.h:148
mlir::MLIRContext
MLIRContext is the top-level object for a collection of MLIR operations.
Definition:
MLIRContext.h:60
mlir::MLIRContext::appendDialectRegistry
void appendDialectRegistry(const DialectRegistry ®istry)
Append the contents of the given dialect registry to the registry associated with this context.
Definition:
MLIRContext.cpp:419
BuiltinAttributes.h
mlir::LLVM
Definition:
ConvertFuncToLLVM.h:21
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
mlir::registerSPIRVDialectTranslation
void registerSPIRVDialectTranslation(DialectRegistry ®istry)
Register the SPIR-V dialect and the translation from it to the LLVM IR in the given registry;.
Definition:
SPIRVToLLVMIRTranslation.cpp:23
Generated on Wed Nov 27 2024 12:34:25 for MLIR by
1.9.1