[Mesa-dev] [PATCH v2 04/14] nir: properly clean up jumps when removing cf nodes

Matt Turner mattst88 at gmail.com
Thu May 21 09:55:03 PDT 2015


On Thu, May 21, 2015 at 9:40 AM, Connor Abbott <cwabbott0 at gmail.com> wrote:
> Before, we might have left dangling predecessors from jumps that were
> going to be removed.
>
> v2: split out from "nir: insert ssa_undef instructions when cleaning up
>     defs/uses"
>
> Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
> ---
>  src/glsl/nir/nir.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
> index a2b5e7c..dc6d63f 100644
> --- a/src/glsl/nir/nir.c
> +++ b/src/glsl/nir/nir.c
> @@ -1214,9 +1214,15 @@ cleanup_cf_node(nir_cf_node *node, nir_function_impl *impl)
>     switch (node->type) {
>     case nir_cf_node_block: {
>        nir_block *block = nir_cf_node_as_block(node);
> -      /* We need to walk the instructions and clean up defs/uses */
> -      nir_foreach_instr(block, instr)
> +      /* We need to walk the instructions and clean up defs/uses,
> +       * as well as clean up any jumps to control flow that may not be getting
> +       * deleted.

I think you can line wrap this block a little better.


More information about the mesa-dev mailing list