#define DEBUG_PIPE 0x1
#define DEBUG_TGSI 0x2
#define DEBUG_TEX 0x4
-#define DEBUG_ASM 0x8
#define DEBUG_SETUP 0x10
#define DEBUG_RAST 0x20
#define DEBUG_QUERY 0x40
#define DEBUG_SCREEN 0x80
-#define DEBUG_JIT 0x100
#define DEBUG_SHOW_TILES 0x200
#define DEBUG_SHOW_SUBTILES 0x400
#define DEBUG_COUNTERS 0x800
-#define DEBUG_NO_LLVM_OPT 0x1000
#ifdef DEBUG
#include "util/u_memory.h"
#include "util/u_cpu_detect.h"
#include "gallivm/lp_bld_init.h"
+#include "gallivm/lp_bld_debug.h"
#include "lp_debug.h"
#include "lp_screen.h"
#include "gallivm/lp_bld_intr.h"
screen->context_ptr_type = LLVMPointerType(context_type, 0);
}
- if (LP_DEBUG & DEBUG_JIT)
+ if (gallivm_debug & GALLIVM_DEBUG_IR) {
LLVMDumpModule(screen->module);
+ }
}
screen->pass = LLVMCreateFunctionPassManager(screen->provider);
LLVMAddTargetData(screen->target, screen->pass);
- if ((LP_DEBUG & DEBUG_NO_LLVM_OPT) == 0) {
+ if ((gallivm_debug & GALLIVM_DEBUG_NO_OPT) == 0) {
/* These are the passes currently listed in llvm-c/Transforms/Scalar.h,
* but there are more on SVN. */
/* TODO: Add more passes */
{ "pipe", DEBUG_PIPE },
{ "tgsi", DEBUG_TGSI },
{ "tex", DEBUG_TEX },
- { "asm", DEBUG_ASM },
{ "setup", DEBUG_SETUP },
{ "rast", DEBUG_RAST },
{ "query", DEBUG_QUERY },
{ "screen", DEBUG_SCREEN },
- { "jit", DEBUG_JIT },
{ "show_tiles", DEBUG_SHOW_TILES },
{ "show_subtiles", DEBUG_SHOW_SUBTILES },
{ "counters", DEBUG_COUNTERS },
- { "nopt", DEBUG_NO_LLVM_OPT },
{NULL, 0}
};
#endif
if (1)
LLVMRunFunctionPassManager(screen->pass, function);
- if (LP_DEBUG & DEBUG_JIT) {
+ if (gallivm_debug & GALLIVM_DEBUG_IR) {
/* Print the LLVM IR to stderr */
lp_debug_dump_value(function);
debug_printf("\n");
variant->jit_function[do_tri_test] = cast_voidptr_to_lp_jit_frag_func(f);
- if (LP_DEBUG & DEBUG_ASM)
+ if (gallivm_debug & GALLIVM_DEBUG_ASM) {
lp_disassemble(f);
+ }
}
}
{
struct lp_fragment_shader_variant *variant;
- if (LP_DEBUG & DEBUG_JIT) {
+ if (gallivm_debug & GALLIVM_DEBUG_IR) {
unsigned i;
tgsi_dump(shader->base.tokens, 0);
/* we need to keep a local copy of the tokens */
shader->base.tokens = tgsi_dup_tokens(templ->tokens);
- if (LP_DEBUG & DEBUG_TGSI) {
+ if (gallivm_debug & GALLIVM_DEBUG_TGSI) {
debug_printf("llvmpipe: Create fragment shader %p:\n", (void *) shader);
tgsi_dump(templ->tokens, 0);
}