lima: Fix unused var/function warnings in release build from assertions.
authorEric Anholt <eric@anholt.net>
Tue, 25 Aug 2020 18:32:35 +0000 (11:32 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 22:45:08 +0000 (22:45 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

src/gallium/drivers/lima/ir/gp/nir.c
src/gallium/drivers/lima/ir/gp/scheduler.c
src/gallium/drivers/lima/ir/pp/nir.c

index fd7acc77773aaf2e2ac240afca66f65ff83ff6d1..33fa35c600ab6a4ca86c1da5d181d0d2710d0b91 100644 (file)
@@ -431,13 +431,13 @@ static void gpir_print_shader_db(struct nir_shader *nir, gpir_compiler *comp,
 {
    const struct shader_info *info = &nir->info;
    char *shaderdb;
-   int ret = asprintf(&shaderdb,
-                      "%s shader: %d inst, %d loops, %d:%d spills:fills\n",
-                      gl_shader_stage_name(info->stage),
-                      comp->num_instr,
-                      comp->num_loops,
-                      comp->num_spills,
-                      comp->num_fills);
+   ASSERTED int ret = asprintf(&shaderdb,
+                               "%s shader: %d inst, %d loops, %d:%d spills:fills\n",
+                               gl_shader_stage_name(info->stage),
+                               comp->num_instr,
+                               comp->num_loops,
+                               comp->num_spills,
+                               comp->num_fills);
    assert(ret >= 0);
 
    if (lima_debug & LIMA_DEBUG_SHADERDB)
index 471696d31b027222d80141a30ddb155671ba007b..aeac7284a3d9f3ba7b0b5ffb184f5d28c27862b5 100644 (file)
@@ -394,7 +394,7 @@ static int gpir_get_slots_required(gpir_node *node)
    return 1;
 }
 
-static void verify_ready_list(sched_ctx *ctx)
+static void ASSERTED verify_ready_list(sched_ctx *ctx)
 {
    list_for_each_entry(gpir_node, node, &ctx->ready_list, list) {
       if (!gpir_is_input_node(node)) {
@@ -1123,7 +1123,7 @@ static bool try_spill_nodes(sched_ctx *ctx, gpir_node *orig_node)
    return ctx->total_spill_needed <= 0 && ctx->max_node_spill_needed <= 0;
 }
 
-static int gpir_get_curr_ready_list_slots(sched_ctx *ctx)
+static int ASSERTED gpir_get_curr_ready_list_slots(sched_ctx *ctx)
 {
    int total = 0;
    list_for_each_entry(gpir_node, node, &ctx->ready_list, list) {
@@ -1248,13 +1248,13 @@ static void sched_find_max_nodes(sched_ctx *ctx)
 /* Verify the invariants described in gpir.h, as well as making sure the
  * counts are correct.
  */
-static void verify_max_nodes(sched_ctx *ctx)
+static void ASSERTED verify_max_nodes(sched_ctx *ctx)
 {
    int alu_num_slot_needed_by_max = 0;
    int alu_num_unscheduled_next_max = 0;
    int alu_num_slot_needed_by_store = 0;
    int alu_num_slot_needed_by_non_cplx_store = 0;
-   int alu_max_allowed_next_max = 5;
+   ASSERTED int alu_max_allowed_next_max = 5;
 
    list_for_each_entry(gpir_node, node, &ctx->ready_list, list) {
       if (!gpir_is_input_node(node))
index f101cfcd1ef74cd3348608699ef662d2bdbd5c5d..0235fd18bbbdbeb9a589c271ba4f603133d4c624 100644 (file)
@@ -833,13 +833,13 @@ static void ppir_print_shader_db(struct nir_shader *nir, ppir_compiler *comp,
 {
    const struct shader_info *info = &nir->info;
    char *shaderdb;
-   int ret = asprintf(&shaderdb,
-                      "%s shader: %d inst, %d loops, %d:%d spills:fills\n",
-                      gl_shader_stage_name(info->stage),
-                      comp->cur_instr_index,
-                      comp->num_loops,
-                      comp->num_spills,
-                      comp->num_fills);
+   ASSERTED int ret = asprintf(&shaderdb,
+                               "%s shader: %d inst, %d loops, %d:%d spills:fills\n",
+                               gl_shader_stage_name(info->stage),
+                               comp->cur_instr_index,
+                               comp->num_loops,
+                               comp->num_spills,
+                               comp->num_fills);
    assert(ret >= 0);
 
    if (lima_debug & LIMA_DEBUG_SHADERDB)