[Mesa-dev] [PATCH 1/9] nir/vars_to_ssa: don't rewrite removed instructions

Jason Ekstrand jason at jlekstrand.net
Fri May 8 22:50:07 PDT 2015


Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com

On Fri, May 8, 2015 at 10:03 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
> We were rewriting the uses of the intrinsic instruction to point to
> something else after removing it, which only happened to work since we
> were lax about having dangling uses when removing instructions. Fix that
> up.
>
> Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
> ---
>  src/glsl/nir/nir_lower_vars_to_ssa.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/nir/nir_lower_vars_to_ssa.c b/src/glsl/nir/nir_lower_vars_to_ssa.c
> index ccb8f99..8d0ae1b 100644
> --- a/src/glsl/nir/nir_lower_vars_to_ssa.c
> +++ b/src/glsl/nir/nir_lower_vars_to_ssa.c
> @@ -647,11 +647,12 @@ rename_variables_block(nir_block *block, struct lower_variables_state *state)
>                                intrin->num_components, NULL);
>
>              nir_instr_insert_before(&intrin->instr, &mov->instr);
> -            nir_instr_remove(&intrin->instr);
>
>              nir_ssa_def_rewrite_uses(&intrin->dest.ssa,
>                                       nir_src_for_ssa(&mov->dest.dest.ssa),
>                                       state->shader);
> +
> +            nir_instr_remove(&intrin->instr);
>              break;
>           }
>
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list