[Mesa-dev] [PATCH 03/15] i965/fs: Switch to a do-while loop in copy propagation dataflow.

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


The fixed-point algorithm needs to run at least once, so a do-while loop
is more natural.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 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 379605c..5efa812 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -166,9 +166,9 @@ fs_copy_prop_dataflow::setup_kills()
 void
 fs_copy_prop_dataflow::run()
 {
-   bool cont = true;
+   bool cont;
 
-   while (cont) {
+   do {
       cont = false;
 
       for (int b = 0; b < cfg->num_blocks; b++) {
@@ -198,7 +198,7 @@ fs_copy_prop_dataflow::run()
             }
          }
       }
-   }
+   } while (cont);
 }
 
 bool
-- 
1.8.3.4



More information about the mesa-dev mailing list