[Mesa-dev] [RFC] vc4: Remove logically dead variable 'handled_qinst_cond'

Rhys Kidd rhyskidd at gmail.com
Fri Feb 12 04:55:56 UTC 2016


Variable no longer is read, and always set to true.

Accordingly, the later assert() serves no active current purpose. The prior
limb of the test 'qinst->cond == QPU_COND_ALWAYS' will never trigger an assert()
as is. If it did previously define a relevant test, this should be revisited
in a subsequent patch.

Found with GCC warning:

mesa/src/gallium/drivers/vc4/vc4_qpu_emit.c: In function 'vc4_generate_code':
mesa/src/gallium/drivers/vc4/vc4_qpu_emit.c:315:22: warning: variable 'handled_qinst_cond' set but not used [-Wunused-but-set-variable]
                 bool handled_qinst_cond = true;
                      ^

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
---
 src/gallium/drivers/vc4/vc4_qpu_emit.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index b06702af..2cac65e 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -312,8 +312,6 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                         break;
                 }
 
-                bool handled_qinst_cond = true;
-
                 switch (qinst->op) {
                 case QOP_RCP:
                 case QOP_RSQ:
@@ -477,15 +475,11 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                                                     src[0], src[1]) | unpack);
                                 set_last_cond_add(c, qinst->cond);
                         }
-                        handled_qinst_cond = true;
                         set_last_dst_pack(c, qinst);
 
                         break;
                 }
 
-                assert(qinst->cond == QPU_COND_ALWAYS ||
-                       handled_qinst_cond);
-
                 if (qinst->sf) {
                         assert(!qir_is_multi_instruction(qinst));
                         *last_inst(c) |= QPU_SF;
-- 
2.5.0



More information about the mesa-dev mailing list