summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-12-16 23:30:40 -0800
committerJason Ekstrand <[email protected]>2016-12-22 16:27:19 -0800
commit8962cc96ec2bc1eb561a438512adc5042e2c8d34 (patch)
tree5cac4bd3a8f828c988679d57d6b637d4247a72a3 /src/mesa
parent6d9f576b56e53e26315aa589c72f399dc29e9672 (diff)
i965: Use nir_opt_trivial_continues and nir_opt_if
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index a52d614b516..6f37e97a86f 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -429,6 +429,15 @@ nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
OPT(nir_opt_algebraic);
OPT(nir_opt_constant_folding);
OPT(nir_opt_dead_cf);
+ if (OPT(nir_opt_trivial_continues)) {
+ /* 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(nir_copy_prop);
+ OPT(nir_opt_dce);
+ }
+ OPT(nir_opt_if);
if (nir->options->max_unroll_iterations != 0) {
OPT(nir_opt_loop_unroll, indirect_mask);
}