panfrost/midgard: Skip register allocation if there's no work to do
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 22 Apr 2019 15:03:26 +0000 (17:03 +0200)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 2 May 2019 15:29:41 +0000 (15:29 +0000)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index 348ec861404a281943efd8be0d401599f08aa366..d4d26b9a25e9b2d5b7ae5c14d5d18050d0e2fdd2 100644 (file)
@@ -2058,6 +2058,9 @@ allocate_registers(compiler_context *ctx)
                        print_mir_block(block);
         }
 
+        if (!ctx->temp_count)
+                return;
+
         /* Let's actually do register allocation */
         int nodes = ctx->temp_count;
         struct ra_graph *g = ra_alloc_interference_graph(regs, nodes);