mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 21:40:20 +01:00
nir: Don't forget if-uses in new nir_opt_dead_cf liveness check
Commit08bfd710a2. (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:08bfd710a2nir/dead_cf: Stop relying on liveness analysis Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
b9eed05e7f
commit
d6337b59f6
1 changed files with 10 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue