lima/ppir: enable vectorize optimization
authorErico Nunes <nunes.erico@gmail.com>
Sat, 10 Aug 2019 20:46:02 +0000 (22:46 +0200)
committerErico Nunes <nunes.erico@gmail.com>
Sun, 25 Aug 2019 18:29:12 +0000 (18:29 +0000)
pp has vector units and some operations can be optimized when bundled
together.
Benchmarking this with piglit shaders shows that the instruction count
can be greatly reduced on many examples with vectorize.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
src/gallium/drivers/lima/lima_program.c

index cb05c6f..b9c4cbc 100644 (file)
@@ -171,6 +171,11 @@ lima_program_optimize_fs_nir(struct nir_shader *s)
 
    do {
       progress = false;
+      NIR_PASS(progress, s, nir_opt_vectorize);
+   } while (progress);
+
+   do {
+      progress = false;
 
       NIR_PASS_V(s, nir_lower_vars_to_ssa);
       NIR_PASS(progress, s, nir_lower_alu_to_scalar, alu_lower);