summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_misc.h
diff options
context:
space:
mode:
authorFrank Henigman <[email protected]>2013-10-01 15:15:41 -0400
committerJosé Fonseca <[email protected]>2014-05-14 11:05:00 +0100
commit2c73102dc33bb2ac2475cecd0614a5889db36630 (patch)
tree37efd6abc770837420e84b42aa302590c491b06c /src/gallium/auxiliary/gallivm/lp_bld_misc.h
parent2ea923cf571235dfe573c35c3f0d90f632bd86d8 (diff)
gallivm: One code memory pool with deferred free.
Provide a JITMemoryManager derivative which puts all generated code into one memory pool instead of creating a new one each time code is generated. This saves significant memory per shader as the pool size is 512K and a small shader occupies just several K. This memory manager also defers freeing generated code until you tell it to do so, making it possible to destroy the LLVM engine while keeping the code, thus enabling future memory savings. v2: Fix compilation errors with LLVM 3.4 (Jose) Signed-off-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.h')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index 1f735fbcde6..847894bb035 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -39,6 +39,8 @@ extern "C" {
#endif
+struct lp_generated_code;
+
extern void
lp_set_target_options(void);
@@ -54,11 +56,15 @@ lp_build_load_volatile(LLVMBuilderRef B, LLVMValueRef PointerVal,
extern int
lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
+ struct lp_generated_code **OutCode,
LLVMModuleRef M,
unsigned OptLevel,
int useMCJIT,
char **OutError);
+extern void
+lp_free_generated_code(struct lp_generated_code *code);
+
#ifdef __cplusplus
}