Mesa (master): nir: silence a couple new compiler warnings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 12 03:35:04 UTC 2019


Module: Mesa
Branch: master
Commit: 02c2863df514cf24ec6464f6daa9f299bcf542e1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=02c2863df514cf24ec6464f6daa9f299bcf542e1

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Mar 11 20:12:15 2019 -0600

nir: silence a couple new compiler warnings

[33/630] Compiling C object 'src/compiler/nir/nir at sta/nir_loop_analyze.c.o'.
../src/compiler/nir/nir_loop_analyze.c: In function ‘try_find_trip_count_vars_in_iand’:
../src/compiler/nir/nir_loop_analyze.c:846:29: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    if (*ind == NULL || *ind && (*ind)->type != basic_induction ||
                             ^
[85/630] Compiling C object 'src/compiler/nir/nir at sta/nir_opt_loop_unroll.c.o'.
../src/compiler/nir/nir_opt_loop_unroll.c: In function ‘complex_unroll_single_terminator’:
../src/compiler/nir/nir_opt_loop_unroll.c:494:17: warning: unused variable ‘unroll_loc’ [-Wunused-variable]
    nir_cf_node *unroll_loc =
                 ^
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/compiler/nir/nir_loop_analyze.c    | 2 +-
 src/compiler/nir/nir_opt_loop_unroll.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_loop_analyze.c b/src/compiler/nir/nir_loop_analyze.c
index bc116f4d1d7..c8304611b28 100644
--- a/src/compiler/nir/nir_loop_analyze.c
+++ b/src/compiler/nir/nir_loop_analyze.c
@@ -843,7 +843,7 @@ try_find_trip_count_vars_in_iand(nir_alu_instr **alu,
    }
 
    /* Try the other iand src if needed */
-   if (*ind == NULL || *ind && (*ind)->type != basic_induction ||
+   if (*ind == NULL || (*ind && (*ind)->type != basic_induction) ||
        !is_var_constant(*limit)) {
       src = iand->src[1].src.ssa;
       if (src->parent_instr->type == nir_instr_type_alu) {
diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c
index 9ab0a924c82..06ec78b8068 100644
--- a/src/compiler/nir/nir_opt_loop_unroll.c
+++ b/src/compiler/nir/nir_opt_loop_unroll.c
@@ -491,7 +491,7 @@ complex_unroll_single_terminator(nir_loop *loop)
    unsigned num_times_to_clone = loop->info->max_trip_count + 1;
 
    nir_cf_list lp_body;
-   nir_cf_node *unroll_loc =
+   MAYBE_UNUSED nir_cf_node *unroll_loc =
       complex_unroll_loop_body(loop, terminator, &lp_header, &lp_body,
                                remap_table, num_times_to_clone);
 




More information about the mesa-commit mailing list