summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/jitter/JitManager.h')
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
index 2f479314c76..5659191525d 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
@@ -124,12 +124,21 @@ private:
struct JitManager
{
JitManager(uint32_t w, const char* arch, const char* core);
- ~JitManager(){};
+ ~JitManager()
+ {
+ for (auto* pExec : mvExecEngines)
+ {
+ delete pExec;
+ }
+ }
- JitLLVMContext mContext; ///< LLVM compiler
- llvm::IRBuilder<> mBuilder; ///< LLVM IR Builder
- llvm::ExecutionEngine* mpExec;
- JitCache mCache;
+ JitLLVMContext mContext; ///< LLVM compiler
+ llvm::IRBuilder<> mBuilder; ///< LLVM IR Builder
+ llvm::ExecutionEngine* mpExec;
+ std::vector<llvm::ExecutionEngine*> mvExecEngines;
+ JitCache mCache;
+ llvm::StringRef mHostCpuName;
+ llvm::CodeGenOpt::Level mOptLevel;
// Need to be rebuilt after a JIT and before building new IR
llvm::Module* mpCurrentModule;
@@ -148,11 +157,14 @@ struct JitManager
// Debugging support
std::unordered_map<llvm::StructType*, llvm::DIType*> mDebugStructMap;
+ void CreateExecEngine(std::unique_ptr<llvm::Module> M);
void SetupNewModule();
void DumpAsm(llvm::Function* pFunction, const char* fileName);
static void DumpToFile(llvm::Function* f, const char* fileName);
- static void DumpToFile(llvm::Module* M, const char* fileName, llvm::AssemblyAnnotationWriter* annotater = nullptr);
+ static void DumpToFile(llvm::Module* M,
+ const char* fileName,
+ llvm::AssemblyAnnotationWriter* annotater = nullptr);
static std::string GetOutputDir();
// Debugging support methods
@@ -183,8 +195,10 @@ struct JitManager
class InterleaveAssemblyAnnotater : public llvm::AssemblyAnnotationWriter
{
public:
- void emitInstructionAnnot(const llvm::Instruction *pInst, llvm::formatted_raw_ostream &OS) override;
+ void emitInstructionAnnot(const llvm::Instruction* pInst,
+ llvm::formatted_raw_ostream& OS) override;
std::vector<std::string> mAssembly;
+
private:
uint32_t mCurrentLineNo = 0;
};