nir: Allow more than just ALU instructions in 'weak' GVN
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 17 Nov 2022 09:59:37 +0000 (01:59 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 14 Dec 2022 20:56:55 +0000 (20:56 +0000)
commit0521027182cdae1b6008a23354a722661ef231ff
tree0185cb0bb508427aadf004918491a7fcf8f8c5f0
parentd5d03a7273dc12001831d6ff067c011e158873a6
nir: Allow more than just ALU instructions in 'weak' GVN

This removes the ALU-only restriction on the "weak" GVN introduced by
the previous commit.  This makes it slightly more aggressive, allowing
it to coalesce things like UBO loads (still within sister then/else
blocks).  This also can have surprisingly large cascading effects.

I was concerned that this might increase register pressure, but
shader-db and fossil-db show effectively no change in spills/fills,
so it seems to be fine.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19823>
src/compiler/nir/nir_opt_gcm.c