spirv: Hand-roll fewer vtn_ssa_value creations
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 30 May 2020 17:27:54 +0000 (12:27 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Fri, 24 Jul 2020 03:43:21 +0000 (22:43 -0500)
commit47ebb50cab3bfd41000f517e83ad0bac57fc4085
tree9b107b2c5e33d401eef1edaf8ffd502999a33023
parent085ade412554c1e1e55aee5a4267bd13ec432d10
spirv: Hand-roll fewer vtn_ssa_value creations

Previously, we created our vtn_ssa_value in _vtn_variable_load_store
manually as we did the recursive load/store.  Instead, we now create the
SSA value before calling into the recursive function.  This is a tiny
bit less efficient but it removes a case of hand-rolling vtn_ssa_value
creation.  For symmetry, we make _vtn_block_load_store assume the value
is already created.  Finally, we remove a trivial hand-rolled case in
vtn_composite_extract.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5278>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_variables.c