freedreno/ir3: change opt passes
authorRob Clark <robdclark@gmail.com>
Fri, 26 Jan 2018 15:43:48 +0000 (10:43 -0500)
committerRob Clark <robdclark@gmail.com>
Sat, 10 Feb 2018 19:54:58 +0000 (14:54 -0500)
There are more useful nir passes added since initial conversion to nir.
But ir3 was never updated to use them.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_nir.c

index e76b39b..3706a02 100644 (file)
@@ -98,8 +98,22 @@ ir3_optimize_loop(nir_shader *s)
                progress |= OPT(s, nir_opt_dce);
                progress |= OPT(s, nir_opt_cse);
                progress |= OPT(s, nir_opt_peephole_select, 16);
+               progress |= OPT(s, nir_opt_intrinsics);
                progress |= OPT(s, nir_opt_algebraic);
                progress |= OPT(s, nir_opt_constant_folding);
+               progress |= OPT(s, nir_opt_dead_cf);
+               if (OPT(s, nir_opt_trivial_continues)) {
+                       progress |= true;
+                       /* If nir_opt_trivial_continues makes progress, then we need to clean
+                        * things up if we want any hope of nir_opt_if or nir_opt_loop_unroll
+                        * to make progress.
+                        */
+                       OPT(s, nir_copy_prop);
+                       OPT(s, nir_opt_dce);
+               }
+               progress |= OPT(s, nir_opt_if);
+               progress |= OPT(s, nir_opt_remove_phis);
+               progress |= OPT(s, nir_opt_undef);
 
        } while (progress);
 }