Mesa (master): i965/fs: Unindent can_coalesce_vars().

Matt Turner mattst88 at kemper.freedesktop.org
Fri Apr 18 17:18:13 UTC 2014


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed Apr  9 14:23:07 2014 -0700

i965/fs: Unindent can_coalesce_vars().

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 .../drivers/dri/i965/brw_fs_register_coalesce.cpp  |   55 ++++++++++----------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
index 6a8842d..01b672f 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp
@@ -80,39 +80,40 @@ can_coalesce_vars(brw::fs_live_variables *live_intervals,
                   const exec_list *instructions, const fs_inst *inst,
                   int var_to, int var_from)
 {
-   if (live_intervals->vars_interfere(var_from, var_to)) {
-      /* We know that the live ranges of A (var_from) and B (var_to)
-       * interfere because of the ->vars_interfere() call above. If the end
-       * of B's live range is after the end of A's range, then we know two
-       * things:
-       *  - the start of B's live range must be in A's live range (since we
-       *    already know the two ranges interfere, this is the only remaining
-       *    possibility)
-       *  - the interference isn't of the form we're looking for (where B is
-       *    entirely inside A)
-       */
-      if (live_intervals->end[var_to] > live_intervals->end[var_from])
-         return false;
+   if (!live_intervals->vars_interfere(var_from, var_to))
+      return true;
+
+   /* We know that the live ranges of A (var_from) and B (var_to)
+    * interfere because of the ->vars_interfere() call above. If the end
+    * of B's live range is after the end of A's range, then we know two
+    * things:
+    *  - the start of B's live range must be in A's live range (since we
+    *    already know the two ranges interfere, this is the only remaining
+    *    possibility)
+    *  - the interference isn't of the form we're looking for (where B is
+    *    entirely inside A)
+    */
+   if (live_intervals->end[var_to] > live_intervals->end[var_from])
+      return false;
 
-      int scan_ip = -1;
+   int scan_ip = -1;
 
-      foreach_list(n, instructions) {
-         fs_inst *scan_inst = (fs_inst *)n;
-         scan_ip++;
+   foreach_list(n, instructions) {
+      fs_inst *scan_inst = (fs_inst *)n;
+      scan_ip++;
 
-         if (scan_inst->is_control_flow())
-            return false;
+      if (scan_inst->is_control_flow())
+         return false;
 
-         if (scan_ip <= live_intervals->start[var_to])
-            continue;
+      if (scan_ip <= live_intervals->start[var_to])
+         continue;
 
-         if (scan_ip > live_intervals->end[var_to])
-            break;
+      if (scan_ip > live_intervals->end[var_to])
+         break;
 
-         if (scan_inst->dst.equals(inst->dst) ||
-             scan_inst->dst.equals(inst->src[0]))
-            return false;
-      }
+      if (scan_inst->dst.equals(inst->dst) ||
+          scan_inst->dst.equals(inst->src[0]))
+         return false;
    }
 
    return true;




More information about the mesa-commit mailing list