[Mesa-dev] [PATCH 08/15] i965/fs: Simplify liveout calculation.

Kenneth Graunke kenneth at whitecape.org
Mon Aug 12 13:11:28 PDT 2013


Excluding the existing liveout bits is a deviation from the textbook
algorithm.  The reason for doing so was to determine if the value
changed, which means the fixed-point algorithm needs to run for another
iteration.

The simpler way to do that is to save the value from step (N-1) and
compare it to the new value at step N.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 2970af6..2ab7734 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -194,13 +194,12 @@ fs_copy_prop_dataflow::run()
       /* Update liveout for all blocks. */
       for (int b = 0; b < cfg->num_blocks; b++) {
          for (int i = 0; i < bitset_words; i++) {
-            BITSET_WORD new_liveout = (bd[b].livein[i] &
-                                       ~bd[b].kill[i] &
-                                       ~bd[b].liveout[i]);
-            if (new_liveout) {
-               bd[b].liveout[i] |= new_liveout;
+            const BITSET_WORD old_liveout = bd[b].liveout[i];
+
+            bd[b].liveout[i] |= bd[b].livein[i] & ~bd[b].kill[i];
+
+            if (old_liveout != bd[b].liveout[i])
                progress = true;
-            }
          }
       }
 
-- 
1.8.3.4



More information about the mesa-dev mailing list