X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fgallivm%2Flp_bld_debug.h;h=1ea13326458089f7754531ba61ac0dda2b4419b3;hb=085c3abf27082f72978e011a652a5ece2f518099;hp=7b010cbdb0986d728aafc3c236ce98747b7a5b14;hpb=e5c7d1e1c8ccb493c63e33d017c28b5cf4a55829;p=mesa.git diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h index 7b010cbdb09..1ea13326458 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h @@ -36,14 +36,41 @@ #include "util/u_string.h" -static INLINE void +#define GALLIVM_DEBUG_TGSI (1 << 0) +#define GALLIVM_DEBUG_IR (1 << 1) +#define GALLIVM_DEBUG_ASM (1 << 2) +#define GALLIVM_DEBUG_PERF (1 << 3) +#define GALLIVM_DEBUG_GC (1 << 4) +#define GALLIVM_DEBUG_DUMP_BC (1 << 5) + +#define GALLIVM_PERF_NO_BRILINEAR (1 << 0) +#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1) +#define GALLIVM_PERF_NO_QUAD_LOD (1 << 2) +#define GALLIVM_PERF_NO_OPT (1 << 3) +#define GALLIVM_PERF_NO_AOS_SAMPLING (1 << 4) + +#ifdef __cplusplus +extern "C" { +#endif + + +extern unsigned gallivm_perf; + +#ifdef DEBUG +extern unsigned gallivm_debug; +#else +#define gallivm_debug 0 +#endif + + +static inline void lp_build_name(LLVMValueRef val, const char *format, ...) { #ifdef DEBUG char name[32]; va_list ap; va_start(ap, format); - util_vsnprintf(name, sizeof name, format, ap); + vsnprintf(name, sizeof name, format, ap); va_end(ap); LLVMSetValueName(val, name); #else @@ -53,12 +80,25 @@ lp_build_name(LLVMValueRef val, const char *format, ...) } +void +lp_debug_dump_value(LLVMValueRef value); + + boolean lp_check_alignment(const void *ptr, unsigned alignment); void -lp_disassemble(const void* func); +lp_disassemble(LLVMValueRef func, const void *code); + + +void +lp_profile(LLVMValueRef func, const void *code); + + +#ifdef __cplusplus +} +#endif #endif /* !LP_BLD_DEBUG_H */