From ca5be008bc55a5190171d91994c3251fddb4d8d9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 14 Dec 2015 18:18:03 -0800 Subject: [PATCH] nir/lower_system_values: Stop supporting non-SSA The one user of this (i965) only ever calls it while in SSA form. Reviewed-by: Eric Anholt --- src/glsl/nir/nir_lower_system_values.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_system_values.c index 21904f81b97..03a98147ba9 100644 --- a/src/glsl/nir/nir_lower_system_values.c +++ b/src/glsl/nir/nir_lower_system_values.c @@ -40,17 +40,15 @@ convert_instr(nir_intrinsic_instr *instr) void *mem_ctx = ralloc_parent(instr); + assert(instr->dest.is_ssa); + nir_intrinsic_op op = nir_intrinsic_from_system_value(var->data.location); nir_intrinsic_instr *new_instr = nir_intrinsic_instr_create(mem_ctx, op); - if (instr->dest.is_ssa) { - nir_ssa_dest_init(&new_instr->instr, &new_instr->dest, - instr->dest.ssa.num_components, NULL); - nir_ssa_def_rewrite_uses(&instr->dest.ssa, - nir_src_for_ssa(&new_instr->dest.ssa)); - } else { - nir_dest_copy(&new_instr->dest, &instr->dest, mem_ctx); - } + nir_ssa_dest_init(&new_instr->instr, &new_instr->dest, + instr->dest.ssa.num_components, NULL); + nir_ssa_def_rewrite_uses(&instr->dest.ssa, + nir_src_for_ssa(&new_instr->dest.ssa)); nir_instr_insert_before(&instr->instr, &new_instr->instr); nir_instr_remove(&instr->instr); -- 2.30.2