diff options
author | Jason Ekstrand <[email protected]> | 2018-07-24 10:08:20 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-08-23 21:44:14 -0500 |
commit | 02a5442dd7a76905ad906cd80e57c019a83144b0 (patch) | |
tree | 89d70b756cee590e5af54c469d19537e9076972f | |
parent | fa6417495c7096d337965345a0f2ad8a18115b19 (diff) |
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 <[email protected]>
-rw-r--r-- | src/intel/compiler/brw_nir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 29ad68fdb2a..cb5f18eb69b 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -541,6 +541,7 @@ brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler, bool progress; do { progress = false; + OPT(nir_split_array_vars, nir_var_local); OPT(nir_lower_vars_to_ssa); OPT(nir_opt_copy_prop_vars); @@ -648,6 +649,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir) OPT(nir_lower_global_vars_to_local); OPT(nir_split_var_copies); + OPT(nir_split_struct_vars, nir_var_local); /* Run opt_algebraic before int64 lowering so we can hopefully get rid * of some int64 instructions. |