pan/bi: Gate late DCE/CSE on "optimize"
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 23 Mar 2022 13:22:40 +0000 (09:22 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Mar 2022 19:00:13 +0000 (19:00 +0000)
Otherwise we can end up with unlowered ATOM.i32 on Valhall.

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

src/panfrost/bifrost/bifrost_compile.c

index 6b98657..b7f1f8a 100644 (file)
@@ -4125,8 +4125,10 @@ bi_compile_variant_nir(nir_shader *nir,
         bi_lower_fau(ctx);
 
         /* Lowering FAU can create redundant moves. Run CSE+DCE to clean up. */
-        bi_opt_cse(ctx);
-        bi_opt_dead_code_eliminate(ctx);
+        if (likely(optimize)) {
+                bi_opt_cse(ctx);
+                bi_opt_dead_code_eliminate(ctx);
+        }
 
         /* Analyze before register allocation to avoid false dependencies. The
          * skip bit is a function of only the data flow graph and is invariant