diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-09-09 12:09:44 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-09-11 13:29:29 +0100 |
commit | dcc5d7f67220bc93aa7a351658649877c7e4cf69 (patch) | |
tree | 720424cecef9793f994cccbf61c6fd840aed50c4 /src/gallium/auxiliary/gallivm/lp_bld_arit.c | |
parent | c0d41d0404285df4f3a8728ddc3b451e54011c7a (diff) |
gallivm: Add a new debug flag to warn about performance issues.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_arit.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index e0d30be98d..dce3c3745b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -56,6 +56,7 @@ #include "lp_bld_intr.h" #include "lp_bld_logic.h" #include "lp_bld_pack.h" +#include "lp_bld_debug.h" #include "lp_bld_arit.h" @@ -1850,9 +1851,11 @@ lp_build_pow(struct lp_build_context *bld, LLVMValueRef y) { /* TODO: optimize the constant case */ - if(LLVMIsConstant(x) && LLVMIsConstant(y)) + if (gallivm_debug & GALLIVM_DEBUG_PERF && + LLVMIsConstant(x) && LLVMIsConstant(y)) { debug_printf("%s: inefficient/imprecise constant arithmetic\n", __FUNCTION__); + } return lp_build_exp2(bld, lp_build_mul(bld, lp_build_log2(bld, x), y)); } @@ -1907,9 +1910,11 @@ lp_build_polynomial(struct lp_build_context *bld, assert(lp_check_value(bld->type, x)); /* TODO: optimize the constant case */ - if(LLVMIsConstant(x)) + if (gallivm_debug & GALLIVM_DEBUG_PERF && + LLVMIsConstant(x)) { debug_printf("%s: inefficient/imprecise constant arithmetic\n", __FUNCTION__); + } for (i = num_coeffs; i--; ) { LLVMValueRef coeff; @@ -1981,9 +1986,11 @@ lp_build_exp2_approx(struct lp_build_context *bld, if(p_exp2_int_part || p_frac_part || p_exp2) { /* TODO: optimize the constant case */ - if(LLVMIsConstant(x)) + if (gallivm_debug & GALLIVM_DEBUG_PERF && + LLVMIsConstant(x)) { debug_printf("%s: inefficient/imprecise constant arithmetic\n", __FUNCTION__); + } assert(type.floating && type.width == 32); @@ -2096,9 +2103,11 @@ lp_build_log2_approx(struct lp_build_context *bld, if(p_exp || p_floor_log2 || p_log2) { /* TODO: optimize the constant case */ - if(LLVMIsConstant(x)) + if (gallivm_debug & GALLIVM_DEBUG_PERF && + LLVMIsConstant(x)) { debug_printf("%s: inefficient/imprecise constant arithmetic\n", __FUNCTION__); + } assert(type.floating && type.width == 32); |