Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
LLVM_Runtime_Linker.h
Go to the documentation of this file.
1#ifndef HALIDE_LLVM_RUNTIME_LINKER_H
2#define HALIDE_LLVM_RUNTIME_LINKER_H
3
4/** \file
5 * Support for linking LLVM modules that comprise the runtime.
6 */
7
8#include <memory>
9#include <string>
10#include <vector>
11
12namespace llvm {
13class GlobalValue;
14class Module;
15class LLVMContext;
16class Triple;
17} // namespace llvm
18
19namespace Halide {
20
21struct Target;
22
23namespace Internal {
24
25/** Return the llvm::Triple that corresponds to the given Halide Target */
26llvm::Triple get_triple_for_target(const Target &target);
27
28/** Create an llvm module containing the support code for a given target. */
29std::unique_ptr<llvm::Module> get_initial_module_for_target(Target, llvm::LLVMContext *, bool for_shared_jit_runtime = false, bool just_gpu = false);
30
31/** Create an llvm module containing the support code for ptx device. */
32std::unique_ptr<llvm::Module> get_initial_module_for_ptx_device(Target, llvm::LLVMContext *c);
33
34/** Link a block of llvm bitcode into an llvm module. */
35void add_bitcode_to_module(llvm::LLVMContext *context, llvm::Module &module,
36 const std::vector<uint8_t> &bitcode, const std::string &name);
37
38/** Take the llvm::Module(s) in extra_modules (if any), add the runtime modules needed for the WASM JIT,
39 * and link into a single llvm::Module. */
40std::unique_ptr<llvm::Module> link_with_wasm_jit_runtime(llvm::LLVMContext *c, const Target &t,
41 std::unique_ptr<llvm::Module> extra_module);
42
43} // namespace Internal
44} // namespace Halide
45
46#endif
llvm::Triple get_triple_for_target(const Target &target)
Return the llvm::Triple that corresponds to the given Halide Target.
std::unique_ptr< llvm::Module > get_initial_module_for_ptx_device(Target, llvm::LLVMContext *c)
Create an llvm module containing the support code for ptx device.
std::unique_ptr< llvm::Module > link_with_wasm_jit_runtime(llvm::LLVMContext *c, const Target &t, std::unique_ptr< llvm::Module > extra_module)
Take the llvm::Module(s) in extra_modules (if any), add the runtime modules needed for the WASM JIT,...
std::unique_ptr< llvm::Module > get_initial_module_for_target(Target, llvm::LLVMContext *, bool for_shared_jit_runtime=false, bool just_gpu=false)
Create an llvm module containing the support code for a given target.
void add_bitcode_to_module(llvm::LLVMContext *context, llvm::Module &module, const std::vector< uint8_t > &bitcode, const std::string &name)
Link a block of llvm bitcode into an llvm module.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A struct representing a target machine and os to generate code for.
Definition Target.h:19