nir_to_tgsi: Enable nir_opt_move.
authorEmma Anholt <emma@anholt.net>
Wed, 8 Dec 2021 19:33:28 +0000 (11:33 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 9 Dec 2021 22:15:53 +0000 (22:15 +0000)
commit5887768f48e4f5116642b48cd21cac93e1c52c97
tree02eb2e5fc9e1017049f55402204e6c24252abb55
parent7d2ea9b0edef2176140629ac3dee6a6809c4abe2
nir_to_tgsi: Enable nir_opt_move.

This moves some ops down to when they're needed, generally reducing the
number of temps in use.  It's not always a win -- sometimes you can end up
moving a generator of a component used by a nir_op_vec down, which means
that op's sources stay live while the vec (whose register likely gets
coalesced with the ops creating it) is also live.  But it's generally
good.

softpipe results:

temps in affected programs: 18115 -> 18026 (-0.49%)
imm in affected programs: 19 -> 22 (15.79%)

r300 results:

instructions in affected programs: 174 -> 178 (2.30%)
vinst in affected programs: 156 -> 160 (2.56%)
sinst in affected programs: 54 -> 50 (-7.41%)
temps in affected programs: 2634 -> 2169 (-17.65%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14096>
src/gallium/auxiliary/nir/nir_to_tgsi.c