nir/opt_uniform_atomics: recognize more complicated invocation comparisons
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 21 Jan 2021 17:27:13 +0000 (17:27 +0000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 25 Jan 2021 21:04:52 +0000 (21:04 +0000)
commiteb70c52abef44f183f2a768fb3a7e5b55fe828e8
tree5eb8f370136300e78f5fd753f11904e1cfad921b
parent12ce72fcfcd07a1da4eb1b8bb2b3ebb1c2e651a7
nir/opt_uniform_atomics: recognize more complicated invocation comparisons

For example, gl_LocalInvocationID.x + gl_LocalInvocationID.y * 8.

fossil-db (GFX10.3):
Totals from 8 (0.01% of 139391) affected shaders:
CodeSize: 15224 -> 14800 (-2.79%)
Instrs: 2880 -> 2798 (-2.85%)
Cycles: 44556 -> 44204 (-0.79%)
VMEM: 407 -> 473 (+16.22%); split: +17.69%, -1.47%
Copies: 491 -> 483 (-1.63%)
Branches: 200 -> 192 (-4.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8654>
src/compiler/nir/nir_opt_uniform_atomics.c