summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-05-16 22:45:27 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-05-19 17:07:41 +0200
commit1e9cbbb1c40b3df8443877410b5d34a2f12e9ab0 (patch)
treee19c49ac1397652e056a1d66dc31cdb71cdad280 /src/gallium/drivers/llvmpipe
parent9e74de884a0595e577ebdfb7c7c13f4fd4d4dff5 (diff)
llvmpipe: do IR counting for shader cache management after optimization.
2ea923cf571235dfe573c35c3f0d90f632bd86d8 had the side effect of IR counting now being done after IR optimization instead of before. Some quick analysis shows that there's roughly 1.5 times more IR instructions before optimization than after, hence the effective shader cache size got quite a bit smaller. Could counter this with an increase of the instruction limit but it probably makes more sense to count them after optimizations, so move that code. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 4872e0d1a30..0b74d15cc64 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -2438,8 +2438,6 @@ generate_fragment(struct llvmpipe_context *lp,
LLVMBuildRetVoid(builder);
gallivm_verify_function(gallivm, function);
-
- variant->nr_instrs += lp_build_count_instructions(function);
}
@@ -2629,6 +2627,8 @@ generate_variant(struct llvmpipe_context *lp,
gallivm_compile_module(variant->gallivm);
+ variant->nr_instrs += lp_build_count_ir_module(variant->gallivm->module);
+
if (variant->function[RAST_EDGE_TEST]) {
variant->jit_function[RAST_EDGE_TEST] = (lp_jit_frag_func)
gallivm_jit_function(variant->gallivm,