nir/lower_system_values: Stop supporting non-SSA
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Dec 2015 02:18:03 +0000 (18:18 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Dec 2015 22:12:31 +0000 (14:12 -0800)
The one user of this (i965) only ever calls it while in SSA form.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/nir/nir_lower_system_values.c

index 21904f81b97828cc9a75aca3b42bf8bd7dd2b130..03a98147ba953d828c04082d36a4b24a2e2987f9 100644 (file)
@@ -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);