Mesa (master): i965/cfg: Factor common code out of switch statement.

Matt Turner mattst88 at kemper.freedesktop.org
Sat Aug 20 18:39:55 UTC 2016


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Aug 17 11:40:01 2016 -0700

i965/cfg: Factor common code out of switch statement.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

---

 src/mesa/drivers/dri/i965/brw_cfg.cpp | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp
index 5d46615..53b32be 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.cpp
+++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp
@@ -177,9 +177,10 @@ cfg_t::cfg_t(exec_list *instructions)
       /* set_next_block wants the post-incremented ip */
       ip++;
 
+      inst->exec_node::remove();
+
       switch (inst->opcode) {
       case BRW_OPCODE_IF:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
 	 /* Push our information onto a stack so we can recover from
@@ -202,7 +203,6 @@ cfg_t::cfg_t(exec_list *instructions)
 	 break;
 
       case BRW_OPCODE_ELSE:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
          cur_else = cur;
@@ -226,7 +226,6 @@ cfg_t::cfg_t(exec_list *instructions)
             set_next_block(&cur, cur_endif, ip - 1);
          }
 
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
          if (cur_else) {
@@ -267,12 +266,10 @@ cfg_t::cfg_t(exec_list *instructions)
             set_next_block(&cur, cur_do, ip - 1);
          }
 
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 	 break;
 
       case BRW_OPCODE_CONTINUE:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
          assert(cur_do != NULL);
@@ -286,7 +283,6 @@ cfg_t::cfg_t(exec_list *instructions)
 	 break;
 
       case BRW_OPCODE_BREAK:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
          assert(cur_while != NULL);
@@ -300,7 +296,6 @@ cfg_t::cfg_t(exec_list *instructions)
 	 break;
 
       case BRW_OPCODE_WHILE:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 
          assert(cur_do != NULL && cur_while != NULL);
@@ -317,7 +312,6 @@ cfg_t::cfg_t(exec_list *instructions)
 	 break;
 
       default:
-         inst->exec_node::remove();
          cur->instructions.push_tail(inst);
 	 break;
       }




More information about the mesa-commit mailing list