[Mesa-dev] [PATCH 1/3] nir/lower_system_values: Stop supporting non-SSA

Jason Ekstrand jason at jlekstrand.net
Mon Dec 14 19:51:49 PST 2015


The one user of this (i965) only ever calls it while in SSA form.
---
 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 21904f8..03a9814 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.5.0.400.gff86faf



More information about the mesa-dev mailing list