radv/nir: call opt_remove_phis after trivial continues.
authorDave Airlie <airlied@redhat.com>
Wed, 13 Sep 2017 02:49:31 +0000 (03:49 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 13 Sep 2017 20:13:03 +0000 (21:13 +0100)
With the shaders in the ssao demo, the nir_opt_if wasn't
working properly without this, after this the if gets optimised
so that loop unrolling gets called.

(loop unrolling fails due to instruction count, but at least
it gets to do that.)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_shader.c

index 1e25ea378ea7c0242809e201ef201472e1a9ddc3..87deb7c3ab7210312a1693ea687289f86bbcc7d3 100644 (file)
@@ -129,6 +129,7 @@ radv_optimize_nir(struct nir_shader *shader)
                 if (nir_opt_trivial_continues(shader)) {
                         progress = true;
                         NIR_PASS(progress, shader, nir_copy_prop);
+                       NIR_PASS(progress, shader, nir_opt_remove_phis);
                         NIR_PASS(progress, shader, nir_opt_dce);
                 }
                 NIR_PASS(progress, shader, nir_opt_if);