Mesa (master): i965/fs: Add a note explaining a detail of register_coalesce_2().

Eric Anholt anholt at kemper.freedesktop.org
Sat Dec 15 00:26:26 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Nov 30 15:54:19 2012 -0800

i965/fs: Add a note explaining a detail of register_coalesce_2().

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

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 5d765e0..94d200e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1855,7 +1855,28 @@ fs_visitor::register_coalesce_2()
       }
 
       inst->remove();
+
+      /* We don't need to recalculate live intervals inside the loop despite
+       * flagging live_intervals_valid because we only use live intervals for
+       * the interferes test, and we must have had a situation where the
+       * intervals were:
+       *
+       *  from  to
+       *  ^
+       *  |
+       *  v
+       *        ^
+       *        |
+       *        v
+       *
+       * Some register R that might get coalesced with one of these two could
+       * only be referencing "to", otherwise "from"'s range would have been
+       * longer.  R's range could also only start at the end of "to" or later,
+       * otherwise it will conflict with "to" when we try to coalesce "to"
+       * into Rw anyway.
+       */
       live_intervals_valid = false;
+
       progress = true;
       continue;
    }




More information about the mesa-commit mailing list