nir/phi_builder: Internal users should use nir_phi_builder_value_set_block_def too
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Oct 2018 16:46:26 +0000 (09:46 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 14 Dec 2018 15:36:05 +0000 (07:36 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_phi_builder.c

index cc5ce81d120fdcc837adf25e65674f322122c229..add3efd2dfcee23431240ae01e4272815171caa6 100644 (file)
@@ -147,7 +147,7 @@ nir_phi_builder_add_value(struct nir_phi_builder *pb, unsigned num_components,
              * value to the magic value NEEDS_PHI.  Later, we create phi nodes
              * on demand in nir_phi_builder_value_get_block_def().
              */
-            val->defs[next->index] = NEEDS_PHI;
+            nir_phi_builder_value_set_block_def(val, next, NEEDS_PHI);
 
             if (pb->work[next->index] < pb->iter_count) {
                pb->work[next->index] = pb->iter_count;
@@ -232,7 +232,7 @@ nir_phi_builder_value_get_block_def(struct nir_phi_builder_value *val,
     *  2) To avoid unneeded recreation of phi nodes and undefs.
     */
    for (dom = block; dom && val->defs[dom->index] == NULL; dom = dom->imm_dom)
-      val->defs[dom->index] = def;
+      nir_phi_builder_value_set_block_def(val, dom, def);
 
    return def;
 }