i965/fs: Switch to a do-while loop in copy propagation dataflow.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 10 Aug 2013 00:50:03 +0000 (17:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 19 Aug 2013 18:29:23 +0000 (11:29 -0700)
The fixed-point algorithm needs to run at least once, so a do-while loop
is more natural.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp

index ddf21df5d28f3b24f4e330e36c0b6b9e91f74166..663b61f385943ce1f1f6389d8bfd1eb2592052dc 100644 (file)
@@ -162,9 +162,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++) {
@@ -194,7 +194,7 @@ fs_copy_prop_dataflow::run()
             }
          }
       }
-   }
+   } while (cont);
 }
 
 bool