pan/midgard: Fix quadword_count handling

Spilling can mess with this considerably.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 2604bbe..22c0d44 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -2359,10 +2359,10 @@
         unsigned first_tag = 0;
 
         mir_foreach_block_from(ctx, initial_block, v) {
-                midgard_bundle *initial_bundle =
-                        util_dynarray_element(&v->bundles, midgard_bundle, 0);
+                if (v->quadword_count) {
+                        midgard_bundle *initial_bundle =
+                                util_dynarray_element(&v->bundles, midgard_bundle, 0);
 
-                if (initial_bundle) {
                         first_tag = initial_bundle->tag;
                         break;
                 }