Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
llvm_jit.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
19 #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
20 #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
21 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
22 #include "llvm/Target/TargetMachine.h"
23 
24 namespace tc {
25 
26 namespace polyhedral {
27 class Scop;
28 }
29 
30 class Jit {
31  private:
32  std::unique_ptr<llvm::TargetMachine> TM_;
33  const llvm::DataLayout DL_;
34  llvm::orc::RTDyldObjectLinkingLayer objectLayer_;
35  llvm::orc::IRCompileLayer<decltype(objectLayer_), llvm::orc::SimpleCompiler>
37 
38  public:
39  Jit();
40 
41  void codegenScop(
42  const std::string& specializedName,
43  const polyhedral::Scop& scop);
44 
45  using ModuleHandle = decltype(compileLayer_)::ModuleHandleT;
46  ModuleHandle addModule(std::unique_ptr<llvm::Module> M);
47  void removeModule(ModuleHandle H);
48 
49  llvm::JITSymbol findSymbol(const std::string name);
50  llvm::JITTargetAddress getSymbolAddress(const std::string name);
51 
52  llvm::TargetMachine& getTargetMachine();
53 };
54 
55 } // namespace tc
llvm::orc::RTDyldObjectLinkingLayer objectLayer_
Definition: llvm_jit.h:34
void removeModule(ModuleHandle H)
void codegenScop(const std::string &specializedName, const polyhedral::Scop &scop)
decltype(compileLayer_)::ModuleHandleT ModuleHandle
Definition: llvm_jit.h:45
llvm::orc::IRCompileLayer< decltype(objectLayer_), llvm::orc::SimpleCompiler > compileLayer_
Definition: llvm_jit.h:36
llvm::JITSymbol findSymbol(const std::string name)
const llvm::DataLayout DL_
Definition: llvm_jit.h:33
llvm::JITTargetAddress getSymbolAddress(const std::string name)
llvm::TargetMachine & getTargetMachine()
ModuleHandle addModule(std::unique_ptr< llvm::Module > M)
std::unique_ptr< llvm::TargetMachine > TM_
Definition: llvm_jit.h:32
Definition: llvm_jit.h:30