<p dir="ltr"><br>
On Nov 21, 2014 1:06 PM, "Matt Turner" <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>> wrote:<br>
><br>
> With bblock_t::end_ip, we can skip entire blocks rather than checking<br>
> every instruction in them. Also by making the loops nested (explicitly,<br>
> it already was a nested loop), the continue seen at the end of the first<br>
> hunk (when viewed with git show -w) will do what the programmer expects.<br>
><br>
> No functional change.<br>
> ---<br>
> .../drivers/dri/i965/brw_fs_register_coalesce.cpp | 28 +++++++++++-----------<br>
> 1 file changed, 14 insertions(+), 14 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp<br>
> index 62788cd..9c8ca32 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs_register_coalesce.cpp<br>
> @@ -126,26 +126,26 @@ can_coalesce_vars(brw::fs_live_variables *live_intervals,<br>
> return false;<br>
><br>
> int start_ip = MIN2(start_to, start_from);<br>
> - int scan_ip = -1;<br>
><br>
> - foreach_block_and_inst(block, fs_inst, scan_inst, cfg) {<br>
> - scan_ip++;<br>
> -<br>
> - if (scan_ip < start_ip)<br>
> + foreach_block(block, cfg) {<br>
> + if (start_ip > block->end_ip)<br>
> continue;<br>
><br>
> - if (scan_inst->is_control_flow())<br>
> - return false;</p>
<p dir="ltr">Is it just me, or did you loose this bit? Maybe it wasn't needed. Also, continuing until we get to a late enough block is not the same as continuing until we get to a certain instruction IP. I'll have to look at the old code some more before I can convince myself that this is not a functional change.<br>
--Jason</p>
<p dir="ltr">> + int scan_ip = block->start_ip - 1;<br>
><br>
> - if (scan_ip <= live_intervals->start[var_to])<br>
> - continue;<br>
> + foreach_inst_in_block(fs_inst, scan_inst, block) {<br>
> + scan_ip++;<br>
> +<br>
> + if (scan_ip <= live_intervals->start[var_to])<br>
> + continue;<br>
><br>
> - if (scan_ip > live_intervals->end[var_to])<br>
> - return true;<br>
> + if (scan_ip > live_intervals->end[var_to])<br>
> + return true;<br>
><br>
> - if (scan_inst->dst.equals(inst->dst) ||<br>
> - scan_inst->dst.equals(inst->src[0]))<br>
> - return false;<br>
> + if (scan_inst->dst.equals(inst->dst) ||<br>
> + scan_inst->dst.equals(inst->src[0]))<br>
> + return false;<br>
> + }<br>
> }<br>
><br>
> return true;<br>
> --<br>
> 2.0.4<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>