diff options
author | Ben Crocker <[email protected]> | 2017-02-14 16:16:01 -0500 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-02-20 18:21:22 +0000 |
commit | a8e9c630f3dc656d107c4252b90c8e991438a3c4 (patch) | |
tree | eadd73716c6b80221371ed77d6d920b8ba3d9935 /src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | |
parent | e8c2a056622324f56559883170793ba3340bb1c2 (diff) |
gallivm: Improve debug output (V2)
Improve debug output from gallivm_compile_module and
lp_build_create_jit_compiler_for_module, printing the
-mcpu and -mattr options passed to LLC.
V2: enclose MAttrs debug_printf block and llc -mcpu debug_printf
in "if (gallivm_debug & <flags>)..."
Signed-off-by: Ben Crocker <[email protected]>
Cc: 12.0 13.0 17.0 <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]> (v2)
[Emil Velikov: rebase]
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 498bbd78095..4115f1e9f40 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -93,6 +93,7 @@ #include "util/u_cpu_detect.h" #include "lp_bld_misc.h" +#include "lp_bld_debug.h" namespace { @@ -619,6 +620,16 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, builder.setMAttrs(MAttrs); + if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) { + int n = MAttrs.size(); + if (n > 0) { + debug_printf("llc -mattr option(s): "); + for (int i = 0; i < n; i++) + debug_printf("%s%s", MAttrs[i].c_str(), (i < n - 1) ? "," : ""); + debug_printf("\n"); + } + } + #if HAVE_LLVM >= 0x0305 StringRef MCPU = llvm::sys::getHostCPUName(); /* @@ -634,6 +645,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, * can't handle. Not entirely sure if we really need to do anything yet. */ builder.setMCPU(MCPU); + if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) { + debug_printf("llc -mcpu option: %s\n", MCPU.str().c_str()); + } #endif ShaderMemoryManager *MM = NULL; |