[Mesa-dev] [PATCH 5/6] i965/fs: Rearrange code to remove most of the gotos

Ian Romanick idr at freedesktop.org
Fri Jun 15 00:43:30 UTC 2018


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/intel/compiler/brw_fs_cmod_propagation.cpp | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp
index 2587d62a950..b4f05613e98 100644
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp
@@ -55,15 +55,11 @@ cmod_propagate_cmp_to_add(const gen_device_info *devinfo, bblock_t *block,
    bool read_flag = false;
 
    foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) {
-      /* The extra scope is to prevent compiler errors for gotos crossing a
-       * variable initializer (cond, below).
-       */
-      {
+      if (scan_inst->opcode == BRW_OPCODE_ADD &&
+          !scan_inst->is_partial_write() &&
+          scan_inst->exec_size == inst->exec_size) {
          bool negate;
 
-         if (scan_inst->opcode != BRW_OPCODE_ADD)
-            goto not_match;
-
          /* A CMP is basically a subtraction.  The result of the
           * subtraction must be the same as the result of the addition.
           * This means that one of the operands must be negated.  So (a +
@@ -83,10 +79,6 @@ cmod_propagate_cmp_to_add(const gen_device_info *devinfo, bblock_t *block,
             goto not_match;
          }
 
-         if (scan_inst->is_partial_write() ||
-             scan_inst->exec_size != inst->exec_size)
-            goto not_match;
-
          /* From the Sky Lake PRM Vol. 7 "Assigning Conditional Mods":
           *
           *    * Note that the [post condition signal] bits generated at
-- 
2.14.4



More information about the mesa-dev mailing list