Mesa (master): i965/fs: Rearrange code to remove most of the gotos

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 16 00:22:47 UTC 2018


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Jun 13 10:11:31 2018 -0700

i965/fs: Rearrange code to remove most of the gotos

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 2587d62a95..b4f05613e9 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




More information about the mesa-commit mailing list