summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_debug.h
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-05-16 01:01:07 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-05-16 22:50:14 +0200
commit3a1da0abeef4144e3c060216d78420f047c6e585 (patch)
tree58802e5e7cf2a04da59c933e3efb6ebf7262fccc /src/gallium/auxiliary/gallivm/lp_bld_debug.h
parent26cac02c51db0f49f6c67d3cd029ce044a087473 (diff)
downloadexternal_mesa3d-3a1da0abeef4144e3c060216d78420f047c6e585.zip
external_mesa3d-3a1da0abeef4144e3c060216d78420f047c6e585.tar.gz
external_mesa3d-3a1da0abeef4144e3c060216d78420f047c6e585.tar.bz2
gallivm: print out how long it takes to optimize shader IR.
Enabled with GALLIVM_DEBUG=perf (which up to now was only used to print warnings for unoptimized code). While some unexpectedly long shader compile times for some shaders were fixed with 8a9f5ecdb116d0449d63f7b94efbfa8b205d826f this should help recognize such problems in the future. For now though only available in debug builds (which are not always suitable for such analysis). And since this uses system time, it might not be all that accurate (even llvmpipe's own rasterization threads might be running at the same time, or just other tasks). (llvmpipe also has LP_DEBUG=counters but this only gives an average per shader and the the total time for all shaders.) This prints information like this: optimizing module fs17_variant0 took 1 msec optimizing module setup_variant_0 took 0 msec optimizing module draw_llvm_vs_variant0 took 9 msec optimizing module draw_llvm_vs_variant0 took 12 msec optimizing module fs17_variant1 took 2 msec v2: rebase for recent gallivm compilation changes, and print time for whole modules instead of functions (otherwise it would be very spammy since it would include all trivial inline sse2 functions), using the shiny new module names, prying them off LLVM using new helper (not available through C bindings). Per function timings, while possibly giving more information (if there'd be a problem only in for instance the partial not the whole function), don't seem all that useful for now. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_debug.h')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_debug.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
index 76c39af..321e09d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h
@@ -76,6 +76,10 @@ lp_build_name(LLVMValueRef val, const char *format, ...)
}
+const char *
+lp_get_module_id(LLVMModuleRef module);
+
+
void
lp_debug_dump_value(LLVMValueRef value);