llvmpipe: correct the debug information printed with GALLIVM_PERF=nopt
authorsuijingfeng <suijingfeng@loongson.cn>
Mon, 19 Jul 2021 15:06:48 +0000 (23:06 +0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 27 Jul 2021 19:57:21 +0000 (19:57 +0000)
commit44aa7e25dd4168d12f6fbe9a3ef6d5dde662ff1e
treec97933bcd1197af1808e8a08fc850329ac6de59a
parent7ff30a0499bd872d77b0f377414bbc03463b9f87
llvmpipe: correct the debug information printed with GALLIVM_PERF=nopt

GALLIVM_PERF_NO_OPT is "belond" to GALLIVM_PERF environment variable,
not GALLIVM_DEBUG. when GALLIVM_PERF=nopt is passed to llvmpipe,
"-sroa -early-cse -simplifycfg -reassociate -constprop -instcombine -gvn"
should not be printed. Those llvm optimation techniques should only be
printed when the default(-O2) optimation is enabled.

$ GALLIVM_PERF=nopt GALLIVM_DEBUG=dumpbc glmark2

Before apply this patch:

  Invoke as "opt -sroa -early-cse -simplifycfg -reassociate -mem2reg -constprop -instcombine -gvn ir_setup_variant_0.bc | llc -O2 [-mcpu=<-mcpu option>] [-mattr=<-mattr option(s)>]"

After apply this patch:

  Invoke as "opt -mem2reg ir_fs304_variant0.bc | llc -O0 [-mcpu=<-mcpu option>] [-mattr=<-mattr option(s)>]"

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: suijingfeng <suijingfeng@loongson.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11994>
src/gallium/auxiliary/gallivm/lp_bld_init.c