swr: [rasterizer jitter] Pass LLVM-IR size into jitter
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 31 Jan 2017 23:05:19 +0000 (17:05 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 8 Feb 2017 19:58:13 +0000 (13:58 -0600)
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
src/gallium/drivers/swr/rasterizer/jitter/jit_api.h

index 5bd21a1cf025a14c5f7e0cc536fcb76939ee8965..64147960a89f64de6995e0adb24046922cf4f518 100644 (file)
@@ -190,9 +190,9 @@ void JitManager::SetupNewModule()
 
 //////////////////////////////////////////////////////////////////////////
 /// @brief Create new LLVM module from IR.
-bool JitManager::SetupModuleFromIR(const uint8_t *pIR)
+bool JitManager::SetupModuleFromIR(const uint8_t *pIR, size_t length)
 {
-    std::unique_ptr<MemoryBuffer> pMem = MemoryBuffer::getMemBuffer(StringRef((const char*)pIR), "");
+    std::unique_ptr<MemoryBuffer> pMem = MemoryBuffer::getMemBuffer(StringRef((const char*)pIR, length), "");
 
     SMDiagnostic Err;
     std::unique_ptr<Module> newModule = parseIR(pMem.get()->getMemBufferRef(), Err, mContext);
index e45ad142b32b3499989ad05f160726c1a85de848..170bdde81a8a05774454178b37c914135e1bfb69 100644 (file)
@@ -178,7 +178,7 @@ struct JitManager
     std::string mCore;
 
     void SetupNewModule();
-    bool SetupModuleFromIR(const uint8_t *pIR);
+    bool SetupModuleFromIR(const uint8_t *pIR, size_t length);
 
     void DumpAsm(llvm::Function* pFunction, const char* fileName);
     static void DumpToFile(llvm::Function *f, const char *fileName);
index 8a08031f25364aeae5a8fb86184fa9d4174dddde..b072eb33e952355e99c39eb3c6ca2d277f0b1b1e 100644 (file)
@@ -59,6 +59,7 @@ struct JIT_COMPILE_INPUT
     SWR_SHADER_TYPE type;
 
     const void* pIR;        ///< Pointer to LLVM IR text.
+    size_t irLength;
 
     bool enableJitSampler;
 };