Mesa (master): nir/dead_cf: rephrase definition of a dead loop node

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Mar 21 16:37:19 UTC 2018


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

Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date:   Mon Mar 19 16:34:16 2018 -0700

nir/dead_cf: rephrase definition of a dead loop node

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_opt_dead_cf.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c
index 53c92ecc28..b15dfdd0c9 100644
--- a/src/compiler/nir/nir_opt_dead_cf.c
+++ b/src/compiler/nir/nir_opt_dead_cf.c
@@ -171,20 +171,19 @@ def_not_live_out(nir_ssa_def *def, void *state)
 }
 
 /*
- * Test if a loop is dead. A loop is dead if:
+ * Test if a loop is dead. A loop node is dead if:
  *
  * 1) It has no side effects (i.e. intrinsics which could possibly affect the
  * state of the program aside from producing an SSA value, indicated by a lack
  * of NIR_INTRINSIC_CAN_ELIMINATE).
  *
- * 2) It has no phi nodes after it, since those indicate values inside the
- * loop being used after the loop.
+ * 2) It has no phi instructions after it, since those indicate values inside
+ * the node being used after the node.
  *
- * 3) If there are no phi nodes after the loop, then the only way a value
- * defined inside the loop can be used outside the loop is if its definition
- * dominates the block after the loop. If none of the definitions that
- * dominate the loop exit are used outside the loop, then the loop is dead
- * and it can be deleted.
+ * 3) None of the values defined inside the node is used outside the node,
+ * i.e. none of the definitions that dominate the node exit are used outside.
+ *
+ * If those conditions hold, then the node is dead and can be deleted.
  */
 
 static bool




More information about the mesa-commit mailing list