From: Kenneth Graunke Date: Sat, 10 Aug 2013 00:50:03 +0000 (-0700) Subject: i965/fs: Switch to a do-while loop in copy propagation dataflow. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0225dea6c49674a27d5be6e933447d8a4ba5a82e;p=mesa.git i965/fs: Switch to a do-while loop in copy propagation dataflow. The fixed-point algorithm needs to run at least once, so a do-while loop is more natural. Signed-off-by: Kenneth Graunke Reviewed-by: Paul Berry --- 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 ddf21df5d28..663b61f3859 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -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