OSDN Git Service

intel/nir: Use the new structure and array splitting passes
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 Jul 2018 17:08:20 +0000 (10:08 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 24 Aug 2018 02:44:14 +0000 (21:44 -0500)
commit02a5442dd7a76905ad906cd80e57c019a83144b0
tree89d70b756cee590e5af54c469d19537e9076972f
parentfa6417495c7096d337965345a0f2ad8a18115b19
intel/nir: Use the new structure and array splitting passes

We call structure splitting once because it is guaranteed to split all
the structures in the entire shader in one go.  We call array splitting
in the loop in case future optimizations turn indirects into direct
dereferences and we can split more arrays.

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15177605 -> 15177605 (0.00%)
    instructions in affected programs: 0 -> 0
    helped: 0
    HURT: 0

This is unsurprising because nir_lower_vars_to_ssa already effectively
does structure and array splitting internally.  It doesn't actually
split the variables but it's ability to reason about aliasing in the
presence of arrays and structures and pick out scalars or vectors to be
lowered to SSA values is fairly advanced.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/intel/compiler/brw_nir.c