v3d: Dump the VIR after register spilling if we were forced to.
authorEric Anholt <eric@anholt.net>
Tue, 26 Feb 2019 00:27:41 +0000 (16:27 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 26 Feb 2019 05:26:24 +0000 (21:26 -0800)
Spilling is unusual, but one often has to debug it when it happens, so
dump it.

src/broadcom/compiler/nir_to_vir.c

index e441bd5997d4a93affb4daa1faad59b5b2008e78..5d2c872f2aaccd4306d45f73ead91d3dd1ffb6ab 100644 (file)
@@ -2670,5 +2670,15 @@ v3d_nir_to_vir(struct v3d_compile *c)
                         vir_remove_thrsw(c);
         }
 
+        if (c->spill_size &&
+            (V3D_DEBUG & (V3D_DEBUG_VIR |
+                          v3d_debug_flag_for_shader_stage(c->s->info.stage)))) {
+                fprintf(stderr, "%s prog %d/%d spilled VIR:\n",
+                        vir_get_stage_name(c),
+                        c->program_id, c->variant_id);
+                vir_dump(c);
+                fprintf(stderr, "\n");
+        }
+
         v3d_vir_to_qpu(c, temp_registers);
 }