nir/from_ssa: Use the nir_block_dominance function instead of our own
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Feb 2015 20:49:08 +0000 (12:49 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 20 Feb 2015 01:06:17 +0000 (17:06 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_from_ssa.c

index 2e7add38d3125d5379a80393283af3bf8a59696b..3625237dd3dc41d67ac43e5190ed911358ddf2c4 100644 (file)
@@ -54,13 +54,8 @@ ssa_def_dominates(nir_ssa_def *a, nir_ssa_def *b)
    } else if (a->parent_instr->block == b->parent_instr->block) {
       return a->live_index <= b->live_index;
    } else {
-      nir_block *block = b->parent_instr->block;
-      while (block->imm_dom != NULL) {
-         if (block->imm_dom == a->parent_instr->block)
-            return true;
-         block = block->imm_dom;
-      }
-      return false;
+      return nir_block_dominates(a->parent_instr->block,
+                                 b->parent_instr->block);
    }
 }