[Mesa-dev] [PATCH 2/4] i965/fs: Wire up control flow correctly in predicated break pass.
Jason Ekstrand
jason at jlekstrand.net
Thu Nov 6 10:07:19 PST 2014
On Wed, Nov 5, 2014 at 4:13 PM, Matt Turner <mattst88 at gmail.com> wrote:
> When the earlier block ended with control flow, we'd mistakenly remove
> some of its links to its children. The same happened with the later
> block.
> ---
> src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp | 10
> +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git
> a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
> index b7a1d7e..047c2c0 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
> @@ -107,10 +107,14 @@ fs_visitor::opt_peephole_predicated_break()
> }
> endif_inst->remove(endif_block);
>
> - earlier_block->children.make_empty();
> - later_block->parents.make_empty();
> + if (!earlier_block->ends_with_control_flow()) {
> + earlier_block->children.make_empty();
> + earlier_block->add_successor(cfg->mem_ctx, jump_block);
> + }
>
> - earlier_block->add_successor(cfg->mem_ctx, jump_block);
> + if (!later_block->starts_with_control_flow()) {
> + later_block->parents.make_empty();
> + }
>
I *think* this is correct. I didn't really understand it before and I
don't 100% now.
Acked-by: Jason Ekstrand <jason.ekstrand at intel.com>
> jump_block->add_successor(cfg->mem_ctx, later_block);
>
> if (earlier_block->can_combine_with(jump_block)) {
> --
> 2.0.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141106/f0c46df0/attachment.html>
More information about the mesa-dev
mailing list