summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-03-28 14:29:30 -0500
committerTim Rowley <[email protected]>2016-05-09 11:25:02 -0500
commitb65f7ec4507122d2a3f258b7ca7c6809de06f097 (patch)
tree579c08c9139bab0d33f13eed1081af9023d993fd /src
parent0062c5f09b4e0031425fdae8102c69cbef5cbff5 (diff)
gallium: enable intel jitevents profiling
LLVM when configured with "intel jitevents" enabled can inform VTune about dynamic code, so individual shaders are attributed profiling data and the resulting assembly can be examined. Acked-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index e47146a7af7..bb08892142a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -81,6 +81,11 @@
#include <llvm/IR/Module.h>
#include <llvm/Support/CBindingWrapping.h>
+#include <llvm/Config/llvm-config.h>
+#if LLVM_USE_INTEL_JITEVENTS
+#include <llvm/ExecutionEngine/JITEventListener.h>
+#endif
+
// Workaround http://llvm.org/PR23628
#if HAVE_LLVM >= 0x0307
# pragma pop_macro("DEBUG")
@@ -629,6 +634,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
ExecutionEngine *JIT;
JIT = builder.create();
+#if LLVM_USE_INTEL_JITEVENTS
+ JITEventListener *JEL = JITEventListener::createIntelJITEventListener();
+ JIT->RegisterJITEventListener(JEL);
+#endif
if (JIT) {
*OutJIT = wrap(JIT);
return 0;