nir/validate: Ensure that phi sources are SSA-only
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 Feb 2015 18:10:59 +0000 (10:10 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 3 Feb 2015 20:52:42 +0000 (12:52 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_validate.c

index 89dfdf88045a20acc537490cbc505d4dff484380..a34a01746515d6cce92c730a613dddea31a0eb42 100644 (file)
@@ -496,16 +496,9 @@ validate_phi_src(nir_phi_instr *instr, nir_block *pred, validate_state *state)
    exec_list_validate(&instr->srcs);
    nir_foreach_phi_src(instr, src) {
       if (src->pred == pred) {
-         unsigned num_components;
-         if (src->src.is_ssa)
-            num_components = src->src.ssa->num_components;
-         else {
-            if (src->src.reg.reg->is_packed)
-               num_components = 4; /* can't check anything */
-            else
-               num_components = src->src.reg.reg->num_components;
-         }
-         assert(num_components == instr->dest.ssa.num_components);
+         assert(src->src.is_ssa);
+         assert(src->src.ssa->num_components ==
+                instr->dest.ssa.num_components);
 
          validate_src(&src->src, state);
          return;