Halide
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 "Target.h"
9 #include <memory>
10 
11 namespace llvm {
12 class GlobalValue;
13 class Module;
14 class LLVMContext;
15 class Triple;
16 } // namespace llvm
17 
18 namespace Halide {
19 namespace Internal {
20 
21 /** Return the llvm::Triple that corresponds to the given Halide Target */
22 llvm::Triple get_triple_for_target(const Target &target);
23 
24 /** Create an llvm module containing the support code for a given target. */
25 std::unique_ptr<llvm::Module> get_initial_module_for_target(Target, llvm::LLVMContext *, bool for_shared_jit_runtime = false, bool just_gpu = false);
26 
27 /** Create an llvm module containing the support code for ptx device. */
28 std::unique_ptr<llvm::Module> get_initial_module_for_ptx_device(Target, llvm::LLVMContext *c);
29 
30 /** Link a block of llvm bitcode into an llvm module. */
31 void add_bitcode_to_module(llvm::LLVMContext *context, llvm::Module &module,
32  const std::vector<uint8_t> &bitcode, const std::string &name);
33 
34 /** Take the llvm::Module(s) in extra_modules (if any), add the runtime modules needed for the WASM JIT,
35  * and link into a single llvm::Module. */
36 std::unique_ptr<llvm::Module> link_with_wasm_jit_runtime(llvm::LLVMContext *c, const Target &t,
37  std::unique_ptr<llvm::Module> extra_module);
38 
39 } // namespace Internal
40 } // namespace Halide
41 
42 #endif
llvm
Definition: CodeGen_Internal.h:19
Halide::Internal::link_with_wasm_jit_runtime
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,...
Halide::Internal::add_bitcode_to_module
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.
Target.h
Halide::Internal::get_triple_for_target
llvm::Triple get_triple_for_target(const Target &target)
Return the llvm::Triple that corresponds to the given Halide Target.
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::get_initial_module_for_ptx_device
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.
Halide::Internal::get_initial_module_for_target
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.