Module: Mesa Branch: master Commit: d6337b59f66eddedcba4853042007507c6d5171d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6337b59f66eddedcba4853042007507c6d5171d
Author: Kenneth Graunke <[email protected]> Date: Tue Feb 19 23:17:28 2019 -0800 nir: Don't forget if-uses in new nir_opt_dead_cf liveness check Commit 08bfd710a25c14df5f690cce9604617536d7c560. (nir/dead_cf: Stop relying on liveness analysis) introduced a new check that iterated through a SSA def's uses, to see if it's used. But it only checked normal uses, and not uses which are part of an 'if' condition. This led to it thinking more nodes were dead than possible. Fixes Piglit's variable-indexing/tcs-output-array-float-index-wr test (and related tests) with the out-of-tree Iris driver. Fixes: 08bfd710a25 nir/dead_cf: Stop relying on liveness analysis Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> --- src/compiler/nir/nir_opt_dead_cf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c index 4cacfed1119..b0e9723d36c 100644 --- a/src/compiler/nir/nir_opt_dead_cf.c +++ b/src/compiler/nir/nir_opt_dead_cf.c @@ -160,6 +160,16 @@ def_only_used_in_cf_node(nir_ssa_def *def, void *_node) return false; } + /* Same check for if-condition uses */ + nir_foreach_if_use(use, def) { + nir_block *use_block = + nir_cf_node_as_block(nir_cf_node_prev(&use->parent_if->cf_node)); + + if (use_block->index <= before->index || + use_block->index >= after->index) + return false; + } + return true; } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
