Mesa (master): nir/from_ssa: Use the nir_block_dominance function instead of our own

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Feb 20 01:09:27 UTC 2015


Module: Mesa
Branch: master
Commit: 0167c38cacc00eef77d7f83d3929cdbc99378d11
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0167c38cacc00eef77d7f83d3929cdbc99378d11

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri Feb  6 12:49:08 2015 -0800

nir/from_ssa: Use the nir_block_dominance function instead of our own

Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>

---

 src/glsl/nir/nir_from_ssa.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c
index 2e7add3..3625237 100644
--- a/src/glsl/nir/nir_from_ssa.c
+++ b/src/glsl/nir/nir_from_ssa.c
@@ -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);
    }
 }
 




More information about the mesa-commit mailing list