nir/loop_analyze: remove cost of redundant selects
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 14 Sep 2022 01:21:00 +0000 (11:21 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Sep 2022 00:31:47 +0000 (00:31 +0000)
commit40c32dfbb1017c4bffaa524b43b37eef9e8e7c9a
tree20736f82b344cf0287d9665242b507c4eadc2106
parent13d0ae593be02cf9b3ed77eea9abeeb7181dd0e5
nir/loop_analyze: remove cost of redundant selects

If we know that a select will be eliminated once the loop is
unrolled than we don't need to count the instruction towards the
cost of the loop.

This change helps 2 loops unroll in an xcom enemy unknown shader
that is loaded full of these redundant selects.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18587>
src/compiler/nir/nir_loop_analyze.c