diff options
author | Jason Ekstrand <[email protected]> | 2015-12-14 19:51:49 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-12-15 10:20:23 -0800 |
commit | de67456d6d756e23142b9701e38ef5e11c301ae1 (patch) | |
tree | 82852be28daf9d578849e2364e0cbedf4579fbcc | |
parent | 64f0ee73e0ade5b6f888b143a1db58ffabfffd99 (diff) |
nir/lower_system_values: Stop supporting non-SSA
The one user of this (i965) only ever calls it while in SSA form.
-rw-r--r-- | src/glsl/nir/nir_lower_system_values.c | 14 |
1 files 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); |