nir: allow specifying a set of opcodes in lower_alu_to_scalar

This can be used by both etnaviv and freedreno/a2xx as they are both vec4
architectures with some instructions being scalar-only.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Jonathan Marek
2019-05-08 12:45:48 -04:00
parent f8bda81887
commit d0bff89159
12 changed files with 24 additions and 19 deletions

View File

@@ -97,7 +97,7 @@ lima_program_optimize_vs_nir(struct nir_shader *s)
progress = false;
NIR_PASS_V(s, nir_lower_vars_to_ssa);
NIR_PASS(progress, s, nir_lower_alu_to_scalar);
NIR_PASS(progress, s, nir_lower_alu_to_scalar, NULL);
NIR_PASS(progress, s, nir_lower_phis_to_scalar);
NIR_PASS(progress, s, nir_copy_prop);
NIR_PASS(progress, s, nir_opt_remove_phis);
@@ -135,7 +135,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
progress = false;
NIR_PASS_V(s, nir_lower_vars_to_ssa);
//NIR_PASS(progress, s, nir_lower_alu_to_scalar);
//NIR_PASS(progress, s, nir_lower_alu_to_scalar, NULL);
NIR_PASS(progress, s, nir_lower_phis_to_scalar);
NIR_PASS(progress, s, nir_copy_prop);
NIR_PASS(progress, s, nir_opt_remove_phis);