pan/bi: Validate before&after pre-RA sched
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 14 Jul 2022 15:30:44 +0000 (11:30 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:23 +0000 (16:03 +0000)
Pre-RA scheduling can move instructions around in nontrivial ways, yet it must
maintain the IR's ordering invariants (for preloads, phis, etc.) Running
validation before and after makes scheduler bugs more obvious.

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

src/panfrost/bifrost/bifrost_compile.c

index 52e50e5..3712cae 100644 (file)
@@ -5109,11 +5109,13 @@ bi_compile_variant_nir(nir_shader *nir,
                 bi_opt_dead_code_eliminate(ctx);
         }
 
-        if (likely(!(bifrost_debug & BIFROST_DBG_NOPSCHED)))
-                bi_pressure_schedule(ctx);
-
         bi_validate(ctx, "Late lowering");
 
+        if (likely(!(bifrost_debug & BIFROST_DBG_NOPSCHED))) {
+                bi_pressure_schedule(ctx);
+                bi_validate(ctx, "Pre-RA scheduling");
+        }
+
         bi_register_allocate(ctx);
 
         if (likely(optimize))