gallivm: Optimize emit_read_invocation's first-invocation loop.
authorEmma Anholt <emma@anholt.net>
Mon, 30 Jan 2023 21:05:45 +0000 (13:05 -0800)
committerEmma Anholt <emma@anholt.net>
Fri, 3 Feb 2023 16:51:12 +0000 (08:51 -0800)
commit0b0246706ed1858285b4169b241784ed8dd1093d
tree3adff3296a2b752d449129ea6b3078b5322f1668
parentd73f72120aef71629cf2a26ef654f68c83b30504
gallivm: Optimize emit_read_invocation's first-invocation loop.

We don't need to deref invoc inside -- invoc is uniform in active
channels, so we can find our first active invocation in the loop, and then
dereference invocation once outside.

50 -> 46 seconds on
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i16vec4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c