mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
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 <sroland@vmware.com>
This commit is contained in:
parent
0062c5f09b
commit
b65f7ec450
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue