glsl: teach copy_propagation_elements to deal with whole variables
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Wed, 27 Jun 2018 21:39:54 +0000 (14:39 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 27 Jul 2018 17:51:25 +0000 (10:51 -0700)
commit134b5a7047f97fbf2537c5e4f31fa08264e1c130
tree9b45982b75c328b58caefd77e4e0321a6726cdd4
parent399228ecad37f420be3028165b94d5d8d33516fc
glsl: teach copy_propagation_elements to deal with whole variables

Keep information in acp_entry whether the entry is full or not, and
use the ACP in more nodes when visiting the instructions:

- add_copy: write whole variables to the ACP state (regardless the
  type).

- visit(ir_dereference_variable *): perform the propagation here if we have a
  full candidate. Element-wise here doesn't apply because the mask
  isn't available at this point.

- visit_leave(ir_assignment *): process beyond scalar and vector, as
  the full variables might have other types.

Also import an improvement from opt_copy_propagation.cpp: if ir_call
is an intrinsic, we know the variables affected, so keep going.

v2: (all from Eric Anholt)
    Describe how acp_entry attributes are used.
    Don't do book-keeping to avoid adding repeated element to
    the dsts in write_elements().

v3: Use _mesa_set_remove_key. (Thomas Helland)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
src/compiler/glsl/opt_copy_propagation_elements.cpp