llvmpipe: Use GALLIVM_DEBUG opt where applicable.

This commit is contained in:
José Fonseca 2010-05-15 11:48:39 +01:00
parent e7c0b4de17
commit 8a3bcba12c
4 changed files with 9 additions and 12 deletions

View file

@ -39,16 +39,13 @@ st_print_current(void);
#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

View file

@ -38,6 +38,7 @@
#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"
@ -151,8 +152,9 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
screen->context_ptr_type = LLVMPointerType(context_type, 0);
}
if (LP_DEBUG & DEBUG_JIT)
if (gallivm_debug & GALLIVM_DEBUG_IR) {
LLVMDumpModule(screen->module);
}
}
@ -180,7 +182,7 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
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 */

View file

@ -53,16 +53,13 @@ static const struct debug_named_value lp_debug_flags[] = {
{ "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

View file

@ -862,7 +862,7 @@ generate_fragment(struct llvmpipe_context *lp,
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");
@ -876,8 +876,9 @@ generate_fragment(struct llvmpipe_context *lp,
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);
}
}
}
@ -889,7 +890,7 @@ generate_variant(struct llvmpipe_context *lp,
{
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);
@ -997,7 +998,7 @@ llvmpipe_create_fs_state(struct pipe_context *pipe,
/* 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);
}