pan/mdg: Defer nir_fuse_io_16 until after opts
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 16 Jun 2020 17:07:02 +0000 (13:07 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 2 Jul 2020 17:37:10 +0000 (13:37 -0400)
Sometimes DCE/etc can opt out things that would force 32-bit, so this is
worthwhile.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5513>

src/panfrost/midgard/midgard_compile.c

index 117ee757162b9e4ce71a61fcedbd2e84f7d16ba7..f9198288ba8003835259921a57ec0025472104aa 100644 (file)
@@ -473,9 +473,6 @@ optimise_nir(nir_shader *nir, unsigned quirks, bool is_blend)
 
         NIR_PASS(progress, nir, midgard_nir_lower_algebraic_early);
 
-        if (!is_blend)
-                NIR_PASS(progress, nir, nir_fuse_io_16);
-
         do {
                 progress = false;
 
@@ -522,6 +519,10 @@ optimise_nir(nir_shader *nir, unsigned quirks, bool is_blend)
                 NIR_PASS(progress, nir, nir_opt_vectorize);
         } while (progress);
 
+        /* Run after opts so it can hit more */
+        if (!is_blend)
+                NIR_PASS(progress, nir, nir_fuse_io_16);
+
         /* Must be run at the end to prevent creation of fsin/fcos ops */
         NIR_PASS(progress, nir, midgard_nir_scale_trig);