diff options
author | Dave Airlie <[email protected]> | 2020-05-15 10:11:56 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2020-06-11 06:05:40 +1000 |
commit | b15ecb1717f695cccbce3f2faece665fdb1074a1 (patch) | |
tree | 51ce4eaf3b16f91c199c7aab1f570f6bea64ff3b /src/gallium/auxiliary/gallivm/lp_bld_init.c | |
parent | 7b7c02d161df2f09fa06b8b0b42caf869a326dc9 (diff) |
gallivm: skip operations if we have a cached object.
If the object is loaded from the cache, a bunch of gallivm/llvm
interactions can be skipped.
Reviewed-by: Roland Scheidegger <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5049>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_init.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_init.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 06214014290..43d02083287 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -573,6 +573,10 @@ gallivm_compile_module(struct gallivm_state *gallivm) gallivm->builder = NULL; } + if (gallivm->cache && gallivm->cache->data_size) { + goto skip_cached; + } + /* Dump bitcode to a file */ if (gallivm_debug & GALLIVM_DEBUG_DUMP_BC) { char filename[256]; @@ -640,6 +644,7 @@ gallivm_compile_module(struct gallivm_state *gallivm) * implicitly created by the EngineBuilder in * lp_build_create_jit_compiler_for_module() */ + skip_cached: LLVMSetDataLayout(gallivm->module, ""); assert(!gallivm->engine); if (!init_gallivm_engine(gallivm)) { |