[Mesa-dev] [MR] Copy propagate direct access of vector elements

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Wed Jan 16 20:13:36 UTC 2019


https://gitlab.freedesktop.org/mesa/mesa/merge_requests/121

First teach copy_prop_vars not to do the wrong thing when it sees an
array deref of a vector; then teach it how to read direct array derefs
-- effectively treating them as a masked access to the full
vector. Those cases don't happen now with the modes of the derefs that
get to copy_prop_vars. But they will be possible once we move the
lowering of UBO/SSBO derefs to later -- so they can take advantage of
optimizations including this pass. CTS has some tests that trigger
those cases.

I've added some "debug" helpers, but I'm not sure if this is something
people want to have around. Given the complexity of the pass, I think
is a net win to have them.

I'm working on indirect access but there's enough material here. I'll
revisit whether is practical to add some support to copy_deref of
direct access after that.

Series diff --stat:

 src/compiler/nir/nir_builder.h            |   4 +-
 src/compiler/nir/nir_opt_copy_prop_vars.c | 440 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------
 src/compiler/nir/tests/vars_tests.cpp     | 284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------
 3 files changed, 552 insertions(+), 176 deletions(-)


Caio Marcelo de Oliveira Filho (9):
      nir/copy_prop_vars: don't get confused by array_deref of vectors
      nir/copy_prop_vars: add debug helpers
      nir/copy_prop_vars: keep track of components in copy_entry
      nir/copy_prop_vars: change test helper to get intrinsics
      nir: nir_build_deref_follower accept array derefs of vectors
      nir/copy_prop_vars: add tests for load/store elements of vectors
      nir/copy_prop_vars: handle load/store of vector elements
      nir/copy_prop_vars: rename/refactor store_to_entry helper
      nir/copy_prop_vars: use NIR_MAX_VEC_COMPONENTS


	Caio


More information about the mesa-dev mailing list