nir/opt_peephole_select: Don't peephole_select expensive math instructions
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 18 Jun 2018 23:11:55 +0000 (16:11 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 17 Dec 2018 21:47:06 +0000 (13:47 -0800)
commit378f9967710e9145f2a4f8eee89d87badbe0e6ea
treeeea53659babbc84c15da3357ab7c01f615c2d3a3
parent8fb8ebfbb05d3323481c8ba6d320b3a3580bad99
nir/opt_peephole_select: Don't peephole_select expensive math instructions

On some GPUs, especially older Intel GPUs, some math instructions are
very expensive.  On those architectures, don't reduce flow control to a
csel if one of the branches contains one of these expensive math
instructions.

This prevents a bunch of cycle count regressions on pre-Gen6 platforms
with a later patch (intel/compiler: More peephole select for pre-Gen6).

v2: Remove stray #if block.  Noticed by Thomas.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/amd/vulkan/radv_shader.c
src/broadcom/compiler/nir_to_vir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_opt_peephole_select.c
src/freedreno/ir3/ir3_nir.c
src/gallium/drivers/radeonsi/si_shader_nir.c
src/gallium/drivers/vc4/vc4_program.c
src/intel/compiler/brw_nir.c
src/mesa/state_tracker/st_glsl_to_nir.cpp