Mesa (master): nir: Silence unused parameter warnings in generated nir_constant_expressions code

2018-03-02 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 3a944316c44621ad824c812907d9d1e0d3ddda46
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a944316c44621ad824c812907d9d1e0d3ddda46

Author: Ian Romanick 
Date:   Fri Feb 16 17:48:57 2018 -0800

nir: Silence unused parameter warnings in generated nir_constant_expressions 
code

Reduces my build from 2075 warnings to 2023 warnings by silencing 52
instances of things like

src/compiler/nir/nir_constant_expressions.c: In function ‘evaluate_bfi’:
src/compiler/nir/nir_constant_expressions.c:1812:61: warning: unused parameter 
‘bit_size’ [-Wunused-parameter]
 evaluate_bfi(MAYBE_UNUSED unsigned num_components, unsigned bit_size,
 ^~~~

Signed-off-by: Ian Romanick 
Reviewed-by: Samuel Iglesias Gonsálvez 

---

 src/compiler/nir/nir_constant_expressions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_constant_expressions.py 
b/src/compiler/nir/nir_constant_expressions.py
index 6571d3b98b..ee92be51db 100644
--- a/src/compiler/nir/nir_constant_expressions.py
+++ b/src/compiler/nir/nir_constant_expressions.py
@@ -389,7 +389,8 @@ struct bool32_vec {
 
 % for name, op in sorted(opcodes.iteritems()):
 static nir_const_value
-evaluate_${name}(MAYBE_UNUSED unsigned num_components, unsigned bit_size,
+evaluate_${name}(MAYBE_UNUSED unsigned num_components,
+ ${"UNUSED" if op_bit_sizes(op) is None else ""} unsigned 
bit_size,
  MAYBE_UNUSED nir_const_value *_src)
 {
nir_const_value _dst_val = { {0, } };

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nir: Silence unused parameter warnings

2018-01-10 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: fd2f4f507fe863567045b9a60c7fca71d73fcd8b
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd2f4f507fe863567045b9a60c7fca71d73fcd8b

Author: Ian Romanick 
Date:   Thu Jan  4 15:28:30 2018 -0800

nir: Silence unused parameter warnings

In file included from src/compiler/nir/nir_opt_algebraic.c:4:0:
src/compiler/nir/nir_search_helpers.h: In function ‘is_not_const’:
src/compiler/nir/nir_search_helpers.h:118:59: warning: unused parameter
‘num_components’ [-Wunused-parameter]
 is_not_const(nir_alu_instr *instr, unsigned src, unsigned num_components,
   ^~
src/compiler/nir/nir_search_helpers.h:119:29: warning: unused parameter
‘swizzle ’ [-Wunused-parameter]
  const uint8_t *swizzle)
 ^~~

Signed-off-by: Ian Romanick 
Reviewed-by: Alejandro Piñeiro 

---

 src/compiler/nir/nir_search_helpers.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_search_helpers.h 
b/src/compiler/nir/nir_search_helpers.h
index 200f2471f8..2e3bd137d6 100644
--- a/src/compiler/nir/nir_search_helpers.h
+++ b/src/compiler/nir/nir_search_helpers.h
@@ -115,8 +115,8 @@ is_zero_to_one(nir_alu_instr *instr, unsigned src, unsigned 
num_components,
 }
 
 static inline bool
-is_not_const(nir_alu_instr *instr, unsigned src, unsigned num_components,
- const uint8_t *swizzle)
+is_not_const(nir_alu_instr *instr, unsigned src, UNUSED unsigned 
num_components,
+ UNUSED const uint8_t *swizzle)
 {
nir_const_value *val = nir_src_as_const_value(instr->src[src].src);
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nir: Silence unused parameter warnings in nir_constant_expression.c

2016-12-19 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 3c7066c1ed1b9f004813995d9a097a083a8bf4d0
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c7066c1ed1b9f004813995d9a097a083a8bf4d0

Author: Ian Romanick 
Date:   Tue Aug 25 17:44:00 2015 +0100

nir: Silence unused parameter warnings in nir_constant_expression.c

nir/nir_constant_expressions.c:290:25: warning: unused parameter 
'num_components' [-Wunused-parameter]
 evaluate_ball3(unsigned num_components, nir_const_value *_src)
 ^
nir/nir_constant_expressions.c: In function 'evaluate_fddx':
nir/nir_constant_expressions.c:1282:57: warning: unused parameter '_src' 
[-Wunused-parameter]
 evaluate_fddx(unsigned num_components, nir_const_value *_src)
 ^

v2: Unconditionally mark the parameters as MAYBE_UNUSED instead of
conditionally adding (void) casts to keep the generator simple.
Suggested by Jason.

Number of total warnings in my build reduced from 1575 to 1485
(reduction of 89).

Signed-off-by: Ian Romanick 
Reviewed-by: Kenneth Graunke 

---

 src/compiler/nir/nir_constant_expressions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_constant_expressions.py 
b/src/compiler/nir/nir_constant_expressions.py
index 6b4d071..2cc106d 100644
--- a/src/compiler/nir/nir_constant_expressions.py
+++ b/src/compiler/nir/nir_constant_expressions.py
@@ -267,8 +267,8 @@ struct bool32_vec {
 
 % for name, op in sorted(opcodes.iteritems()):
 static nir_const_value
-evaluate_${name}(unsigned num_components, unsigned bit_size,
- nir_const_value *_src)
+evaluate_${name}(MAYBE_UNUSED unsigned num_components, unsigned bit_size,
+ MAYBE_UNUSED nir_const_value *_src)
 {
nir_const_value _dst_val = { {0, } };
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nir: Silence unused parameter warnings

2016-05-12 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 098166e1bc68860b2be9230e5241ead014bf254c
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=098166e1bc68860b2be9230e5241ead014bf254c

Author: Ian Romanick 
Date:   Tue Aug 25 18:19:12 2015 +0100

nir: Silence unused parameter warnings

These cases had the parameter removed:

nir/nir_lower_vec_to_movs.c: In function ‘try_coalesce’:
nir/nir_lower_vec_to_movs.c:124:66: warning: unused parameter ‘shader’ 
[-Wunused-parameter]
 try_coalesce(nir_alu_instr *vec, unsigned start_idx, nir_shader *shader)
  ^
nir/nir_lower_io.c: In function ‘load_op’:
nir/nir_lower_io.c:147:32: warning: unused parameter ‘state’ 
[-Wunused-parameter]
 load_op(struct lower_io_state *state,
^

These cases had the parameter (void) silenced because the parameter was
necessary for an interface:

nir/glsl_to_nir.cpp:1900:32: warning: unused parameter 'ir' [-Wunused-parameter]
 nir_visitor::visit(ir_barrier *ir)
^
nir/nir.c: In function ‘remove_use_cb’:
nir/nir.c:802:35: warning: unused parameter ‘state’ [-Wunused-parameter]
 remove_use_cb(nir_src *src, void *state)
   ^
nir/nir.c: In function ‘remove_def_cb’:
nir/nir.c:811:37: warning: unused parameter ‘state’ [-Wunused-parameter]
 remove_def_cb(nir_dest *dest, void *state)
 ^

Number of total warnings in my build reduced from 2543 to 2538
(reduction of 5).

Signed-off-by: Ian Romanick 
Reviewed-by: Kenneth Graunke 

---

 src/compiler/nir/glsl_to_nir.cpp | 2 +-
 src/compiler/nir/nir.c   | 4 
 src/compiler/nir/nir_lower_io.c  | 5 ++---
 src/compiler/nir/nir_lower_vec_to_movs.c | 4 ++--
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index aeeba5d..fb1d421 100644
--- a/src/compiler/nir/glsl_to_nir.cpp
+++ b/src/compiler/nir/glsl_to_nir.cpp
@@ -2007,7 +2007,7 @@ nir_visitor::visit(ir_dereference_array *ir)
 }
 
 void
-nir_visitor::visit(ir_barrier *ir)
+nir_visitor::visit(ir_barrier *)
 {
nir_intrinsic_instr *instr =
   nir_intrinsic_instr_create(this->shader, nir_intrinsic_barrier);
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 71adcb3..cf6ca52 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -893,6 +893,8 @@ src_is_valid(const nir_src *src)
 static bool
 remove_use_cb(nir_src *src, void *state)
 {
+   (void) state;
+
if (src_is_valid(src))
   list_del(>use_link);
 
@@ -902,6 +904,8 @@ remove_use_cb(nir_src *src, void *state)
 static bool
 remove_def_cb(nir_dest *dest, void *state)
 {
+   (void) state;
+
if (!dest->is_ssa)
   list_del(>reg.def_link);
 
diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index d0f3dc7..a839924 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -144,8 +144,7 @@ get_io_offset(nir_builder *b, nir_deref_var *deref,
 }
 
 static nir_intrinsic_op
-load_op(struct lower_io_state *state,
-nir_variable_mode mode, bool per_vertex)
+load_op(nir_variable_mode mode, bool per_vertex)
 {
nir_intrinsic_op op;
switch (mode) {
@@ -270,7 +269,7 @@ nir_lower_io_block(nir_block *block,
 
  nir_intrinsic_instr *load =
 nir_intrinsic_instr_create(state->mem_ctx,
-   load_op(state, mode, per_vertex));
+   load_op(mode, per_vertex));
  load->num_components = intrin->num_components;
 
  nir_intrinsic_set_base(load,
diff --git a/src/compiler/nir/nir_lower_vec_to_movs.c 
b/src/compiler/nir/nir_lower_vec_to_movs.c
index b383fb8..711ddd3 100644
--- a/src/compiler/nir/nir_lower_vec_to_movs.c
+++ b/src/compiler/nir/nir_lower_vec_to_movs.c
@@ -118,7 +118,7 @@ has_replicated_dest(nir_alu_instr *alu)
  * can then call insert_mov as normal.
  */
 static unsigned
-try_coalesce(nir_alu_instr *vec, unsigned start_idx, nir_shader *shader)
+try_coalesce(nir_alu_instr *vec, unsigned start_idx)
 {
assert(start_idx < nir_op_infos[vec->op].num_inputs);
 
@@ -264,7 +264,7 @@ lower_vec_to_movs_block(nir_block *block, nir_function_impl 
*impl)
 continue;
 
  if (!(finished_write_mask & (1 << i)))
-finished_write_mask |= try_coalesce(vec, i, shader);
+finished_write_mask |= try_coalesce(vec, i);
 
  if (!(finished_write_mask & (1 << i)))
 finished_write_mask |= insert_mov(vec, i, shader);

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit


Mesa (master): nir: Silence unused parameter warnings

2015-04-14 Thread Ian Romanick
Module: Mesa
Branch: master
Commit: 67a8610caff15ba9f55ac5ee2404f19033b5bae6
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=67a8610caff15ba9f55ac5ee2404f19033b5bae6

Author: Ian Romanick ian.d.roman...@intel.com
Date:   Mon Apr 13 16:42:59 2015 -0700

nir: Silence unused parameter warnings

nir/nir.h: In function 'nir_validate_shader':
nir/nir.h:1567:56: warning: unused parameter 'shader' [-Wunused-parameter]
 static inline void nir_validate_shader(nir_shader *shader) { }
^
nir/nir_opt_cse.c: In function 'src_is_ssa':
nir/nir_opt_cse.c:165:32: warning: unused parameter 'data' [-Wunused-parameter]
 src_is_ssa(nir_src *src, void *data)
^
nir/nir_opt_cse.c: In function 'dest_is_ssa':
nir/nir_opt_cse.c:171:35: warning: unused parameter 'data' [-Wunused-parameter]
 dest_is_ssa(nir_dest *dest, void *data)
   ^

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Jordan Justen jordan.l.jus...@intel.com
Reviewed-by: Connor Abbott cwabbo...@gmail.com

---

 src/glsl/nir/nir.h |2 +-
 src/glsl/nir/nir_opt_cse.c |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 2d1d870..74772c7 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1570,7 +1570,7 @@ void nir_print_instr(const nir_instr *instr, FILE *fp);
 #ifdef DEBUG
 void nir_validate_shader(nir_shader *shader);
 #else
-static inline void nir_validate_shader(nir_shader *shader) { }
+static inline void nir_validate_shader(nir_shader *shader) { (void) shader; }
 #endif /* DEBUG */
 
 void nir_calc_dominance_impl(nir_function_impl *impl);
diff --git a/src/glsl/nir/nir_opt_cse.c b/src/glsl/nir/nir_opt_cse.c
index db873ce..56d491c 100644
--- a/src/glsl/nir/nir_opt_cse.c
+++ b/src/glsl/nir/nir_opt_cse.c
@@ -151,12 +151,14 @@ nir_instrs_equal(nir_instr *instr1, nir_instr *instr2)
 static bool
 src_is_ssa(nir_src *src, void *data)
 {
+   (void) data;
return src-is_ssa;
 }
 
 static bool
 dest_is_ssa(nir_dest *dest, void *data)
 {
+   (void) data;
return dest-is_ssa;
 }
 

___
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit